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(); } }
protected bool TryDispatch(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage) { RequestHandler handler = this.DispatchHandler(); if (handler != null) { handler.Process(requestMessage, responseMessage); return(true); } return(false); }
public virtual Stream Process(Stream requestStream) { RequestHandler handler = this.DispatchHandler(); if (handler != null) { return(handler.Process(requestStream)); } StreamPipe pipe = new StreamPipe(); this.Process(this.CreateRequestMessage(requestStream), this.CreateResponseMessage(pipe.WriteStream)); return(pipe.ReadStream); }
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)); } }