protected virtual Context CreateContext(object rawContext) { var request = CreateRequest(rawContext); var response = CreateResponse(rawContext); var context = new Context(rawContext,request,response); return context; }
public ICommand GetOrCreateCommand(RouteData routeData,HttpMethods method,Context context) { SortedDictionary<string, Dictionary<HttpMethods,ICommand>> actions = null; if (!_Datas.TryGetValue(routeData.ControllerName, out actions)) { return null; } Dictionary<HttpMethods, ICommand> methods = null; if (!actions.TryGetValue(routeData.ActionName, out methods)) { return null; } foreach (var pair in methods) { if (((int)pair.Key & (int)method) > 0) return pair.Value; } return null; }
protected abstract Task<IArguments> CreateArgumentsAsync(IRequest request,RouteData routeData, Context context);
protected abstract Task<RouteData> RouteAsync(IRequest request, Context context);