Skip to content

Commit

Permalink
fix (#140)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitaly Shcherbinov <[email protected]>
  • Loading branch information
Vitaly086 and Vitaly Shcherbinov authored Nov 20, 2024
1 parent 490a01e commit 4675dab
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/EntityFramework/EfCommandsScorerInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@

namespace Mindbox.DiagnosticContext.EntityFramework;

internal class EfCommandsScorerInterceptor(
IEnumerable<IEfCommandMetricsCounter> metricsCounters)
: DbCommandInterceptor
internal class EfCommandsScorerInterceptor : DbCommandInterceptor
{
private readonly IEnumerable<IEfCommandMetricsCounter> _metricsCounters;

public EfCommandsScorerInterceptor(IEnumerable<IEfCommandMetricsCounter> metricsCounters)
{
_metricsCounters = metricsCounters;
}

public override InterceptionResult<DbDataReader> ReaderExecuting(
DbCommand command,
CommandEventData eventData,
Expand Down Expand Up @@ -92,7 +97,7 @@ public override async ValueTask<int> NonQueryExecutedAsync(

private T ReportCommandStarted<T>(T result)
{
foreach (var counter in metricsCounters)
foreach (var counter in _metricsCounters)
counter.ReportCommandStarted();

return result;
Expand Down

0 comments on commit 4675dab

Please sign in to comment.