protected IEndpointConventionBuilder MapMethod(string method, string pathTemplate, NathanRequestDelegate handler) { var deferredEndPointConventionBuilder = new DeferredEndPointConventionBuilder(); ModuleDescriptor.AddHandlerDescriptor(method, pathTemplate, handler, deferredEndPointConventionBuilder); return(deferredEndPointConventionBuilder); }
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); }
public NathanHandlerDescriptor(string method, string pathTemplate, NathanRequestDelegate requestDelegate, DeferredEndPointConventionBuilder endPointConventionBuilder, NathanModuleDescriptor parentModuleDescriptor) { Method = method; PathTemplate = pathTemplate; RequestDelegate = requestDelegate; EndPointConventionBuilder = endPointConventionBuilder; ParentModuleDescriptor = parentModuleDescriptor; }