Пример #1
0
        public AsyncRestHandlerRoute(string route, AsyncRestHandler handler, PathToRegexUtil.PathToRegexOptions options = null)
        {
            this.PatternKeys = new List <PathToRegexUtil.Token>();
            this.Pattern     = PathToRegexUtil.PathToRegex(
                route.StartsWith("/") ? route : ("/" + route),
                ref this.PatternKeys,
                options ?? DEFAULT_HANDLER_PATH_TO_REGEX_OPTIONS);

            this.TargetAction = null;
            this.ITarget      = null;
            this.Handler      = handler;
        }
Пример #2
0
        public AsyncRestHandlerRoute(Regex pattern, AsyncRestHandler handler, PathToRegexUtil.PathToRegexOptions options = null)
        {
            this.PatternKeys = new List <PathToRegexUtil.Token>();
            this.Pattern     = PathToRegexUtil.PathToRegex(
                pattern,
                ref this.PatternKeys,
                options ?? DEFAULT_HANDLER_PATH_TO_REGEX_OPTIONS);

            this.TargetAction = null;
            this.ITarget      = null;
            this.Handler      = handler;
        }
Пример #3
0
        public RestHandlerRoute(string route, IRestHandlerSingleTarget target, PathToRegexUtil.PathToRegexOptions options = null)
        {
            this.PatternKeys = new List <PathToRegexUtil.Token>();
            this.Pattern     = PathToRegexUtil.PathToRegex(
                route.StartsWith("/") ? route : ("/" + route),
                ref this.PatternKeys,
                options ?? DEFAULT_PATH_TO_REGEX_OPTIONS);

            this.TargetAction = null;
            this.ITarget      = target;
            this.Handler      = null;
        }
Пример #4
0
        public RestHandlerRoute(Regex pattern, IRestHandlerSingleTarget target, PathToRegexUtil.PathToRegexOptions options = null)
        {
            this.PatternKeys = new List <PathToRegexUtil.Token>();
            this.Pattern     = PathToRegexUtil.PathToRegex(
                pattern,
                ref this.PatternKeys,
                options ?? DEFAULT_PATH_TO_REGEX_OPTIONS);

            this.TargetAction = null;
            this.ITarget      = target;
            this.Handler      = null;
        }
Пример #5
0
 public void Patch(Regex routePattern, IRestHandlerSingleTarget target, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"PATCH", new RestHandlerRoute(routePattern, target, options ?? DefaultRouteOptions));
 }
Пример #6
0
 public void Patch(Regex routePattern, RestHandler handler, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"PATCH", new RestHandlerRoute(routePattern, handler, options ?? DefaultHandlerRouteOptions));
 }
Пример #7
0
 public void Patch(string route, RestHandlerRoute.Action action, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"PATCH", new RestHandlerRoute(route, action, options ?? DefaultRouteOptions));
 }
Пример #8
0
 public void Options(string route, RestHandler handler, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"OPTIONS", new RestHandlerRoute(route, handler, options ?? DefaultHandlerRouteOptions));
 }
Пример #9
0
 public void Options(string route, IRestHandlerSingleTarget target, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"OPTIONS", new RestHandlerRoute(route, target, options ?? DefaultRouteOptions));
 }
Пример #10
0
 public void Options(Regex routePattern, RestHandlerRoute.Action action, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"OPTIONS", new RestHandlerRoute(routePattern, action, options ?? DefaultRouteOptions));
 }
Пример #11
0
 public void Delete(Regex routePattern, RestHandler handler, PathToRegexUtil.PathToRegexOptions options = null)
 {
     AddRoute(@"DELETE", new RestHandlerRoute(routePattern, handler, options ?? DefaultHandlerRouteOptions));
 }