public PowerLineEndPointExecutionResult(PowerLinExecutionResultType resultType, PowerLineContext context, Exception exception, PowerLineEndPoint endpoint, PowerLineHandler handler) { this.ResultType = resultType; this.Context = context; this.Exception = exception; this.EndPoint = endpoint; this.Handler = handler; }
public PowerLineHandler SetHandler(PowerLineHandler handler) { if (this.handlers.ContainsKey(handler.HttpMethod)) { this.handlers[handler.HttpMethod] = handler; return(handler); } else { return(this.AddHandler(handler)); } }
public PowerLineEndPoint AddHandler(string endpointName, string httpMethod, Func <PowerLineContext, Task> func) { PowerLineHandler mainHandler = PowerLineHandler.Create(httpMethod, func); if (this.GetEndPoint(endpointName, out PowerLineEndPoint endpoint)) { endpoint.SetHandler(mainHandler); return(endpoint); } else { return(this.AddEndpoint(endpointName, mainHandler)); } }
public PowerLineShadowHandler(string httpMethod, PowerLineHandler baseHandler) : base(httpMethod) { this.BaseHandler = baseHandler; }
public PowerLineHandler AddHandler(PowerLineHandler handler) { this.handlers.Add(handler.HttpMethod, handler); return(handler); }
public PowerLineEndPointExecutionResult(PowerLineContext context, PowerLineEndPoint endPoint, PowerLineHandler handler) : this(PowerLinExecutionResultType.OK, context, null, endPoint, handler) { }
public PowerLineEndPointExecutionResult(PowerLineContext context, PowerLineEndPoint endPoint, PowerLineHandler handler, Exception exception) : this(PowerLinExecutionResultType.HandlerException, context, exception, endPoint, handler) { }