Esempio n. 1
0
 public async Task InvokeAsync(HttpContext context, RequestDelegate next)
 {
     using (provider.CreateScope())
         using (manager.BeginScope())
         {
             await next(context);
         }
 }
Esempio n. 2
0
        public async Task InvokeAsync(HttpContext context, RequestDelegate next)
        {
            using (manager.BeginScope())
                using (provider.CreateScope())
                    using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                    {
                        await next(context);

                        scope.Complete();
                    }
        }