예제 #1
0
파일: Dispacher.cs 프로젝트: yanyitec/yitec
 protected virtual Context CreateContext(object rawContext) {
     
     var request = CreateRequest(rawContext);
     var response = CreateResponse(rawContext);
     var context = new Context(rawContext,request,response);
     return context;
 }
예제 #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;
 }
예제 #3
0
파일: Dispacher.cs 프로젝트: yanyitec/yitec
 protected abstract Task<IArguments> CreateArgumentsAsync(IRequest request,RouteData routeData, Context context);
예제 #4
0
파일: Dispacher.cs 프로젝트: yanyitec/yitec
 protected abstract Task<RouteData> RouteAsync(IRequest request, Context context);