YulerB/EF-Duration-Interceptor

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

★ 1Forks 0C#GitHub ↗Compare

README

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

Contributors

YulerB

Issues