Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

asp.net core miniprofiler

Install-Package MiniProfiler.AspNetCore.Mvc -IncludePrerelease
//Once installed, modify your startup.cs code like the following.

public void ConfigureServices(IServiceCollection services)
{
    services.AddMemoryCache();
    services.AddEntityFrameworkSqlite().AddDbContext<DatabaseContext>();
    services.AddMiniProfiler(options => options.RouteBasePath = "/profiler").AddEntityFramework();
    services.AddControllers();
}
//Next we need add the MiniProfiler middleware, you can do like this.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseMiniProfiler();
    /* Code removed for brevity. */
}
//Next add the following two lines inside the <html> tag in the _Layout.cshtml file.

@using StackExchange.Profiling
@addTagHelper *, MiniProfiler.AspNetCore.Mvc
//You should also specify where in the web page the MiniProfiler window should be displayed, i.e., the render position. To do this, you can include the following statement inside the <body> tag.

<mini-profiler position="@RenderPosition.Right" max-traces="5" />
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# char 
Csharp :: c# merge two xml files 
Csharp :: how to convert object in string JSON c# 
Csharp :: checking if a list contains a value unity 
Csharp :: unity keep screen always on 
Csharp :: c# new list of objects 
Csharp :: c# select a row from datagridview by value 
Csharp :: c# get the first 4 characters in the list 
Csharp :: how to acivate a game object unity 
Csharp :: vb.net add row to datagridview programmatically 
Csharp :: print all complete object in list c# 
Csharp :: dictionary to list c# 
Csharp :: unity get component in parent 
Csharp :: C# new form 
Csharp :: unity banner Ad position 
Csharp :: how to minimum text length in textbox in c# 
Csharp :: c# string to bool 
Csharp :: string tochar array c# 
Csharp :: change sprite color unity 
Csharp :: unity get pivot position 
Csharp :: httpget query parameters c# 
Csharp :: c# count directories in directory and subdirectories 
Csharp :: convert pdf to image c# 
Csharp :: c# arrow 
Csharp :: linq datatable 
Csharp :: npm add auth token 
Csharp :: c# string 
Csharp :: add qtwidgets to cmake file 
Csharp :: convert list string to list enum c# 
Csharp :: how to return a value in c# 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =