// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ProfilerDbContext profilerDbContext) { app.ApplyEasyProfilerPostgreSQL(profilerDbContext); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseSwagger(); app.UseSwaggerUI(options => { options.EnableDeepLinking(); options.ShowExtensions(); options.DisplayRequestDuration(); options.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None); options.RoutePrefix = "api-docs"; options.SwaggerEndpoint("/swagger/EasyProfiler/swagger.json", "EasyProfilerSwagger"); }); app.UseDocumentation(opts => this.Configuration.Bind("DocumentationOptions", opts)); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
/// <summary> /// Database migration for SQL Server. /// </summary> /// <param name="app"> /// IApplicationBuilder /// </param> /// <param name="dbContext"> /// Profiler DbContext /// </param> public static void ApplyEasyProfilerPostgreSQL(this IApplicationBuilder app, ProfilerDbContext dbContext) { dbContext.Database.Migrate(); }
public EasyProfilerManager(ProfilerDbContext profilerDbContext) { this.profilerDbContext = profilerDbContext; }
/// <summary> /// Database migration for SQL Server. /// </summary> /// <param name="app"> /// IApplicationBuilder /// </param> /// <param name="dbContext"> /// Profiler DbContext /// </param> public static void ApplyEasyProfilerSQLServer(this IApplicationBuilder app, ProfilerDbContext dbContext) { var migrations = dbContext.Database.GetPendingMigrations(); dbContext.Database.Migrate(); }