예제 #1
0
        public static void SessionInitializer(string name, Action <Session, Request> callback)
        {
            RouteCallback initializer = new RouteCallback
                                        (
                priority: 1,
                cb: (req) =>
            {
                if (req.GetSession(name) == null)
                {
                    Session s = new Session(name);
                    callback(s, req);
                    return(new PassThrough().AddSession(s));
                }
                return(PassThrough.Skip);
            }
                                        );

            Routing.AddHandler(initializer);
        }
예제 #2
0
 public static void Route(string method, RoutePatternMatch route, Response res) => Routing.AddHandler((MethodArg)method, route, res);
예제 #3
0
 public static void Route(RoutePatternMatch route, RouteCallback_A callback) => Routing.AddHandler(route, callback);
예제 #4
0
 public static void Delete(RoutePatternMatch route, RouteCallback_D callback) => Routing.AddHandler(HTTPMethod.DELETE, route, callback);
예제 #5
0
 public static void Put(RoutePatternMatch route, RouteCallback_D callback) => Routing.AddHandler(HTTPMethod.PUT, route, callback);
예제 #6
0
 public static void Get(RoutePatternMatch route, RouteCallback_B callback) => Routing.AddHandler(HTTPMethod.GET, route, callback);
예제 #7
0
 public static void All(RouteCallback_D callback) => Routing.AddHandler(callback);
예제 #8
0
 public static void All(HTTPMethod method, RouteCallback_D callback) => Routing.AddHandler(method, callback);
예제 #9
0
 public static void Put(string route, RouteCallback_D callback) => Routing.AddHandler(HTTPMethod.PUT, (RouteArg)route, callback);
예제 #10
0
 public static void Patch(string route, RouteCallback_C callback) => Routing.AddHandler(HTTPMethod.PATCH, (RouteArg)route, callback);
예제 #11
0
 public static void Get(string route, RouteCallback_C callback) => Routing.AddHandler(HTTPMethod.GET, (RouteArg)route, callback);
예제 #12
0
 public static void Delete(params PartialController[] controllers) => Array.ForEach(controllers, (PartialController c) => Routing.AddHandler(HTTPMethod.DELETE, (RouteArg)c.Route, c.Callback));
예제 #13
0
 public static void Routes(params Controller[] controllers) => Array.ForEach(controllers, (Controller c) => Routing.AddHandler((MethodArg)c.Method, (RouteArg)c.Route, c.Callback));
예제 #14
0
 public static void Route(HTTPMethod method, RoutePatternMatch route, Response res) => Routing.AddHandler(method, route, res);
예제 #15
0
 public static void Route(HTTPMethod method, RoutePatternMatch route, RouteCallback_D callback) => Routing.AddHandler(method, route, callback);
예제 #16
0
 public static void Route(HTTPMethod method, string route, RouteCallback_A callback) => Routing.AddHandler(method, (RouteArg)route, callback);
예제 #17
0
 public static void Route(HTTPMethod method, string route, Response res) => Routing.AddHandler(method, (RouteArg)route, res);
예제 #18
0
 public static void Put(string route, Response res) => Routing.AddHandler(HTTPMethod.PUT, (RouteArg)route, res);
예제 #19
0
 public static void All(HTTPMethod method, Response res) => Routing.AddHandler(method, res);
예제 #20
0
 public static void Delete(string route, RouteCallback_D callback) => Routing.AddHandler(HTTPMethod.DELETE, (RouteArg)route, callback);
예제 #21
0
 public static void All(Response res) => Routing.AddHandler(res);
예제 #22
0
 public static void Delete(string route, Response res) => Routing.AddHandler(HTTPMethod.DELETE, (RouteArg)route, res);
예제 #23
0
 public static void Patch(RoutePatternMatch route, RouteCallback_C callback) => Routing.AddHandler(HTTPMethod.PATCH, route, callback);
예제 #24
0
 public static void Route(string route, RouteCallback_D callback) => Routing.AddHandler((RouteArg)route, callback);
예제 #25
0
 public static void Put(RoutePatternMatch route, Response res) => Routing.AddHandler(HTTPMethod.PUT, route, res);
예제 #26
0
 public static void Route(string route, Response res) => Routing.AddHandler((RouteArg)route, res);
예제 #27
0
 public static void Delete(RoutePatternMatch route, Response res) => Routing.AddHandler(HTTPMethod.DELETE, route, res);
예제 #28
0
 public static void Route(string method, string route, RouteCallback_D callback) => Routing.AddHandler((MethodArg)method, (RouteArg)route, callback);
예제 #29
0
 public static void Route(string method, string route, Response res) => Routing.AddHandler((MethodArg)method, (RouteArg)route, res);
예제 #30
0
 public static void Route(string method, RoutePatternMatch route, RouteCallback_D callback) => Routing.AddHandler((MethodArg)method, route, callback);