コード例 #1
0
ファイル: Session.cs プロジェクト: chrisrollins/Alabaster
        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);