public void Context() { _nextRequestDelegateIsInvoked = false; _middleware = new TransactionScopeUnitOfWorkMiddleware( unitOfWorkFactory: new FakeUnitOfWorkFactory(), getOrHeadRequestPathsWithoutTransaction: new [] { new Regex(@"/*.js") } ); }
public async Task CreateMiddlewareAndInvokeHandling( RequestDelegate requestDelegate, VolatileResourceManager volatileResourceManager ) { var unitOfWorkFactory = IoC.Resolve <IUnitOfWorkFactory>(); var transactionScopeUnitOfWorkMiddleware = new TransactionScopeUnitOfWorkMiddleware( unitOfWorkFactory: unitOfWorkFactory, transactionScopeEnlistmentAction: volatileResourceManager.EnlistIntoTransactionScope ); var httpContext = new DefaultHttpContext(); await transactionScopeUnitOfWorkMiddleware.InvokeAsync(httpContext, requestDelegate); }