Пример #1
0
        public AsyncRestHandlerRoute(Regex pattern, IAsyncRestHandlerTarget 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;
        }
Пример #2
0
        public AsyncRestHandlerRoute(string route, IAsyncRestHandlerTarget 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;
        }