コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }