Skip to content

MariaDb & MySQL

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

Usage

Install EasyProfiler.MariaDb from Nuget Package

Initilaze EasyProfilerDbContext in Program.cs to save the results.

Sample

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

or

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

and EasyProfilerInterceptor extensions add for own DbContext.

Sample

builder.Services.AddDbContext<SampleDbContext>(options =>
{
    options.UseMySql(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