Class IndexerPattern
- Namespace
- TypedRest.CodeGeneration.Patterns.Generic
- Assembly
- TypedRest.CodeGeneration.dll
A pattern that generates IndexerEndpoints.
public class IndexerPattern : IPattern
- Inheritance
-
objectIndexerPattern
- Implements
- Derived
Methods
ExtractElement<T>(IDictionary<string, IEndpoint>)
Extracts an element endpoint from a set of child endpoints.
protected static T? ExtractElement<T>(IDictionary<string, IEndpoint> children) where T : class, IEndpoint
Parameters
childrenIDictionary<string, IEndpoint>The child endpoints to search for. A potential match will be removed from this dictionary.
Returns
- T
The element endpoint;
nullif none was found.
Type Parameters
TThe type of endpoint to search for.
TryGetEndpoint(PathTree, IPatternMatcher)
Generates an endpoint for the specified path tree, if it matches the pattern.
public virtual IEndpoint? TryGetEndpoint(PathTree tree, IPatternMatcher patternMatcher)
Parameters
treePathTreeThe path tree to try to match against the pattern.
patternMatcherIPatternMatcherThe pattern matcher to use for matching child trees.
Returns
- IEndpoint
The endpoint if the pattern matched;
nullotherwise.