protact miniprofiler .net core code example
Example: asp.net core miniprofiler
Install-Package MiniProfiler.AspNetCore.Mvc -IncludePrerelease
public void ConfigureServices(IServiceCollection services)
{
services.AddMemoryCache();
services.AddEntityFrameworkSqlite().AddDbContext<DatabaseContext>();
services.AddMiniProfiler(options => options.RouteBasePath = "/profiler").AddEntityFramework();
services.AddControllers();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseMiniProfiler();
}
@using StackExchange.Profiling
@addTagHelper *, MiniProfiler.AspNetCore.Mvc
<mini-profiler position="@RenderPosition.Right" max-traces="5" />