我在 asp.net core2.0 应用程序中使用 Miniprofiler。启动.cs
services.AddMiniProfiler(options => {
options.RouteBasePath = "/profiler";
(options.Storage as MemoryCacheStorage).CacheDuration = TimeSpan.FromMinutes(60);
options.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();
options.ResultsAuthorize = request => !Program.DisableProfilingResults;
});
对于每个连接,我都会:
DbConnection connection = new System.Data.SqlClient.SqlConnection(_connectionString);
return new StackExchange.Profiling.Data.ProfiledDbConnection(connection, MiniProfiler.Current);
示例取自这里https://miniprofiler.com/dotnet/HowTo/ProfileSql。在输出信息时,我看到加载了静态内容(js、css 等),包括数据库查询,我该如何禁用它?