public override async Task <int> SaveChangesAsync() { var interceptionContext = GetInterceptionContext(); var interceptors = DbInterceptorsProvider.Get().ToList(); interceptors.ForEach(i => i.Before(interceptionContext)); var result = await base.SaveChangesAsync(CancellationToken.None); interceptors.ForEach(i => i.After(interceptionContext)); return(result); }
public override int SaveChanges() { var interceptionContext = GetInterceptionContext(); var interceptors = DbInterceptorsProvider.Get().ToList(); interceptors.ForEach(i => i.Before(interceptionContext)); var result = base.SaveChanges(); interceptors.ForEach(i => i.After(interceptionContext)); return(result); }