Exemplo n.º 1
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;
        }
Exemplo n.º 2
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;
        }