예제 #1
0
        public IEndpoint TryGetEndpoint(PathTree tree, IPatternMatcher patternMatcher)
        {
            var operations = tree.Item?.Operations.Keys ?? new OperationType[0];

            if (!RequiredOperations.All(operations.Contains))
            {
                return(null);
            }

            var endpoint = BuildEndpoint(tree.Item);

            endpoint?.Children.AddRange(patternMatcher.GetEndpoints(tree));
            return(endpoint);
        }
예제 #2
0
        public IEndpoint?TryGetEndpoint(PathTree tree, IPatternMatcher patternMatcher)
        {
            var item = tree.Item;

            if (item == null || !RequiredOperations.All(item.Operations.Keys.Contains))
            {
                return(null);
            }

            var endpoint = BuildEndpoint(item);

            endpoint?.Children.AddRange(patternMatcher.GetEndpoints(tree));
            return(endpoint);
        }