public void RegisterEndpointHandler(string pathMatch, HttpConsumerAction handler) { if (_started) { throw new InvalidOperationException("The host has already been started, no additional endpoints may be added."); } lock (_endpoints) { List <Endpoint> handlers; if (_endpoints.TryGetValue(pathMatch, out handlers)) { handlers.Add(new Endpoint(pathMatch, handler)); } else { _endpoints.Add(pathMatch, new List <Endpoint> { new Endpoint(pathMatch, handler) }); } } }
void OwinHostContext.RegisterEndpointHandler(string pathMatch, HttpConsumerAction handler) { _context.RegisterEndpointHandler(pathMatch, handler); }
public void RegisterEndpointHandler(string pathMatch, HttpConsumerAction handler) { if (_started) throw new InvalidOperationException("The host has already been started, no additional endpoints may be added."); lock (_endpoints) { List<Endpoint> handlers; if (_endpoints.TryGetValue(pathMatch, out handlers)) handlers.Add(new Endpoint(pathMatch, handler)); else _endpoints.Add(pathMatch, new List<Endpoint> {new Endpoint(pathMatch, handler)}); } }
public Endpoint(string pathMatch, HttpConsumerAction handler) { PathMatch = pathMatch; Handler = handler; }