ReportSharp.DatabaseReporter
1.0.5
dotnet add package ReportSharp.DatabaseReporter --version 1.0.5
NuGet\Install-Package ReportSharp.DatabaseReporter -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ReportSharp.DatabaseReporter" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ReportSharp.DatabaseReporter --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ReportSharp.DatabaseReporter, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ReportSharp.DatabaseReporter as a Cake Addin #addin nuget:?package=ReportSharp.DatabaseReporter&version=1.0.5 // Install ReportSharp.DatabaseReporter as a Cake Tool #tool nuget:?package=ReportSharp.DatabaseReporter&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ReportSharp.DatabaseReporter-1.0.5:
Description:
DatabaseReporter for ReportSharp package
Dependencies:
ReportSharp 1.0.5 or later
dotnet-ef tool 3.1 or later
Dotnet Core 3.1 or later
Usage:
Note:
You need to install and configure ReportSharp 1.0.5
or later to use
this package.
Dotnet 5 or below:
- Add following lines to
ConfigureServices
method inStartup
class:
services.AddReportSharp(options => {
options.ConfigReportSharp(configBuilder =>
configBuilder.SetWatchdogPrefix("/")
);
var assemblyName = typeof(Startup).Assembly.GetName().Name;
// For request reporter
options.AddRequestReporter(() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
// For exception reporter
options.AddExceptionReporter(() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
// For data reporter
options.AddDataReporter(() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
// For request, exception and data reporters
options.AddReporter<DatabaseReporter, DatabaseReportOptionsBuilder<ReportSharpDbContext>>(
() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
});
Note: if you want to it for all reporters, you can use only AddReporter
method.
- Add following lines to
Configure
method inStartup
class:
app.UseReportSharp(configure => {
configure.UseReportSharpMiddleware<ReportSharpMiddleware>();
});
- Add ReportSharp migrations with following command in terminal:
dotnet ef migrations add ReportSharp -c ReportSharpDbContext
- Apply ReportSharp migration on the database with following command:
dotnet ef database update -c ReportSharpDbContext
Dotnet 6 or later:
- Add following lines to
services
section, beforebuilder.Build()
line:
services.AddReportSharp(options => {
options.ConfigReportSharp(configBuilder =>
configBuilder.SetWatchdogPrefix("/")
);
var assemblyName = typeof(Startup).Assembly.GetName().Name;
// For request reporter
options.AddRequestReporter(() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
// For exception reporter
options.AddExceptionReporter(() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
// For data reporter
options.AddDataReporter(() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
// For request, exception and data reporters
options.AddReporter<DatabaseReporter, DatabaseReportOptionsBuilder<ReportSharpDbContext>>(
() => new DatabaseReportOptionsBuilder<ReportSharpDbContext>()
.SetOptionsBuilder(dbOptions => {
dbOptions.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection"),
sql => sql.MigrationsAssembly(assemblyName)
);
})
);
});
Note: if you want to it for all reporters, you can use only AddReporter
method.
- Add following lines to
Configure
section, somewhere afterbuilder.Build()
line and beforeapp.Run()
line:
app.UseReportSharp(configure => {
configure.UseReportSharpMiddleware<ReportSharpMiddleware>();
});
- Add ReportSharp migrations with following command in terminal:
dotnet ef migrations add ReportSharp -c ReportSharpDbContext
- Apply ReportSharp migration on the database with following command:
dotnet ef database update -c ReportSharpDbContext
Donation:
If you like it, you can support me with USDT
:
TJ57yPBVwwK8rjWDxogkGJH1nF3TGPVq98
forUSDT TRC20
0x743379201B80dA1CB680aC08F54b058Ac01346F1
forUSDT ERC20
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.EntityFrameworkCore (>= 5.0.11)
- Microsoft.EntityFrameworkCore.Relational (>= 5.0.11)
- ReportSharp (>= 1.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ReportSharp.DatabaseReporter:
Package | Downloads |
---|---|
ReportSharp.Api
Api for ReportSharp.DatabaseReporter of ReportSharp package |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.5 | 2,585 | 12/31/2021 |