Пример #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;
 }