Table of Contents

Class IndexerPattern

Namespace
TypedRest.CodeGeneration.Patterns.Generic
Assembly
TypedRest.CodeGeneration.dll

A pattern that generates IndexerEndpoints.

public class IndexerPattern : IPattern
Inheritance
object
IndexerPattern
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

children IDictionary<string, IEndpoint>

The child endpoints to search for. A potential match will be removed from this dictionary.

Returns

T

The element endpoint; null if none was found.

Type Parameters

T

The 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

tree PathTree

The path tree to try to match against the pattern.

patternMatcher IPatternMatcher

The pattern matcher to use for matching child trees.

Returns

IEndpoint

The endpoint if the pattern matched; null otherwise.