Class DirectRouteFactoryContext
Represents a context that supports creating a direct route.
public class DirectRouteFactoryContext
- Inheritance
-
DirectRouteFactoryContext
- Inherited Members
Constructors
DirectRouteFactoryContext(string, IReadOnlyCollection<HttpActionDescriptor>, IInlineConstraintResolver, bool)
Initializes a new instance of theDirectRouteFactoryContext class.
public DirectRouteFactoryContext(string prefix, IReadOnlyCollection<HttpActionDescriptor> actions, IInlineConstraintResolver inlineConstraintResolver, bool targetIsAction)
Parameters
prefix
stringThe route prefix, if any, defined by the controller.
actions
IReadOnlyCollection<HttpActionDescriptor>The action descriptors to which to create a route.
inlineConstraintResolver
IInlineConstraintResolverThe inline constraint resolver.
targetIsAction
boolA value indicating whether the route is configured at the action or controller level.
Properties
Actions
Gets the action descriptors to which to create a route.
public IReadOnlyCollection<HttpActionDescriptor> Actions { get; }
Property Value
- IReadOnlyCollection<HttpActionDescriptor>
The action descriptors to which to create a route.
InlineConstraintResolver
Gets the inline constraint resolver.
public IInlineConstraintResolver InlineConstraintResolver { get; }
Property Value
- IInlineConstraintResolver
The inline constraint resolver.
Prefix
Gets the route prefix, if any, defined by the controller.
public string Prefix { get; }
Property Value
- string
The route prefix, if any, defined by the controller.
TargetIsAction
Gets a value indicating whether the route is configured at the action or controller level.
public bool TargetIsAction { get; }
Property Value
- bool
true when the route is configured at the action level; otherwise false (if the route is configured at the controller level).
Methods
CreateBuilder(string)
Creates a route builder that can build a route matching this context.
public IDirectRouteBuilder CreateBuilder(string template)
Parameters
template
stringThe route template.
Returns
- IDirectRouteBuilder
A route builder that can build a route matching this context.
CreateBuilder(string, IInlineConstraintResolver)
Creates a route builder that can build a route matching this context.
public IDirectRouteBuilder CreateBuilder(string template, IInlineConstraintResolver constraintResolver)
Parameters
template
stringThe route template.
constraintResolver
IInlineConstraintResolverThe inline constraint resolver to use, if any; otherwise, null.
Returns
- IDirectRouteBuilder
A route builder that can build a route matching this context.