Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }