Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.86 KB

README.md

File metadata and controls

28 lines (20 loc) · 1.86 KB

EF-Duration-Interceptor

.NET .NET GITHUB PACKAGE CodeQL NuGet Badge Sonarqube Quality Gate Status Coverage

Entity Framework Command Duration Interceptor - Outputs as a response header.

To add the interceptor to DbContext call the AddInterceptors method when configuring your DbContext.

using EFDurationInterceptor;
...
services
  .AddDbContext<NvmContext>((provider, options) => options
  .UseSqlServer(connectionString)
  .AddInterceptors(provider.GetRequiredService<DurationDbInterceptor>())); 

A value is added to the response headers for both the duration setting up connections and the duration executing commands.

Screenshot