public async Task InvokeAsync(HttpContext context, RequestDelegate next) { using (provider.CreateScope()) using (manager.BeginScope()) { await next(context); } }
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(); } }