示例#1
0
        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)
                    });
                }
            }
        }
示例#2
0
 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)});
            }
        }
示例#4
0
 public Endpoint(string pathMatch, HttpConsumerAction handler)
 {
     PathMatch = pathMatch;
     Handler   = handler;
 }
 public Endpoint(string pathMatch, HttpConsumerAction handler)
 {
     PathMatch = pathMatch;
     Handler = handler;
 }