public override Stream Process(Stream requestStream) { ServiceScopeWrapper serviceScope = this.RootContainer.CreateServiceScope(); this.RequestContainer = serviceScope.ServiceProvider; try { RequestHandler handler = this.DispatchHandler(); if (this.PreferenceContext.RespondAsync) { return(handler.ProcessAsynchronously(requestStream)); } return(handler.Process(requestStream)); } catch (Exception e) { ErrorHandler handler = new ErrorHandler(this, e); return(handler.Process(null)); } finally { serviceScope.Dispose(); } }
public override Stream Process(Stream requestStream) { try { RequestHandler handler = this.DispatchHandler(); if (this.PreferenceContext.RespondAsync) { return(handler.ProcessAsynchronously(requestStream)); } return(handler.Process(requestStream)); } catch (Exception e) { ErrorHandler handler = new ErrorHandler(this, e); return(handler.Process(null)); } }