예제 #1
0
        protected IEndpointConventionBuilder MapMethod(string method, string pathTemplate, NathanRequestDelegate handler)
        {
            var deferredEndPointConventionBuilder = new DeferredEndPointConventionBuilder();

            ModuleDescriptor.AddHandlerDescriptor(method, pathTemplate, handler, deferredEndPointConventionBuilder);
            return(deferredEndPointConventionBuilder);
        }
예제 #2
0
        public void AddHandlerDescriptor(string method, string pathTemplate, NathanRequestDelegate requestDelegate,
                                         DeferredEndPointConventionBuilder endPointConventionBuilder)
        {
            var prefixedPathTemplate = $"{BasePath}/{pathTemplate}";
            var handlerDescriptor    = new NathanHandlerDescriptor(method, prefixedPathTemplate, requestDelegate, endPointConventionBuilder, this);

            HandlerDescriptors.Add(handlerDescriptor.Key, handlerDescriptor);
        }
예제 #3
0
 public NathanHandlerDescriptor(string method, string pathTemplate, NathanRequestDelegate requestDelegate,
                                DeferredEndPointConventionBuilder endPointConventionBuilder, NathanModuleDescriptor parentModuleDescriptor)
 {
     Method                    = method;
     PathTemplate              = pathTemplate;
     RequestDelegate           = requestDelegate;
     EndPointConventionBuilder = endPointConventionBuilder;
     ParentModuleDescriptor    = parentModuleDescriptor;
 }