Ejemplo n.º 1
0
 protected virtual Context CreateContext(object rawContext) {
     
     var request = CreateRequest(rawContext);
     var response = CreateResponse(rawContext);
     var context = new Context(rawContext,request,response);
     return context;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 protected abstract Task<IArguments> CreateArgumentsAsync(IRequest request,RouteData routeData, Context context);
Ejemplo n.º 4
0
 protected abstract Task<RouteData> RouteAsync(IRequest request, Context context);