Skip to content

SQL Server

Furkan Güngör edited this page Mar 27, 2022 · 4 revisions

Usage

Install EasyProfiler.SQLServer from Nuget Package

Initilaze EasyProfilerDbContext in Program.cs to save the results.

Sample

builder.Services.AddEasyProfilerDbContext(options =>
{
   options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"));
}, options=>
{
   options.Resulation = Resulation.HIGH;
});

or

builder.Services.AddEasyProfilerDbContext(options =>
{
   options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"));
}, options=>
{
   options.UseCronExpression = true;
   options.CronExpression = "* 1 * * *";
});

and EasyProfilerInterceptor extensions add for own DbContext.

Sample

builder.Services.AddDbContext<OwnDbContext>(options =>
{
    options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))
    .AddEasyProfiler(services);
});

Migrations

Use the MigrateEasyProfiler extension method for pending migrations.

Sample

var app = builder.Build();

app.MigrateEasyProfiler();

Welcome to the EasyProfiler wiki!

Topics:

Clone this wiki locally