Table of Contents

Class DirectRouteFactoryContext

Namespace
System.Web.Mvc.Routing
Assembly
System.Web.Mvc.dll

Represents a context that supports creating a direct route.

public class DirectRouteFactoryContext
Inheritance
DirectRouteFactoryContext
Inherited Members

Constructors

DirectRouteFactoryContext(string, string, IReadOnlyCollection<ActionDescriptor>, IInlineConstraintResolver, bool)

Initializes a new instance of the DirectRouteFactoryContext class.

public DirectRouteFactoryContext(string areaPrefix, string controllerPrefix, IReadOnlyCollection<ActionDescriptor> actions, IInlineConstraintResolver inlineConstraintResolver, bool targetIsAction)

Parameters

areaPrefix string

The route prefix, if any, defined by the area.

controllerPrefix string

The route prefix, if any, defined by the controller.

actions IReadOnlyCollection<ActionDescriptor>

The action descriptors to which to create a route.

inlineConstraintResolver IInlineConstraintResolver

The inline constraint resolver.

targetIsAction bool

A 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<ActionDescriptor> Actions { get; }

Property Value

IReadOnlyCollection<ActionDescriptor>

The action descriptors to which to create a route.

AreaPrefix

Gets the route prefix, if any, defined by the area.

public string AreaPrefix { get; }

Property Value

string

The route prefix, if any, defined by the area.

ControllerPrefix

Gets the route prefix, if any, defined by the controller.

public string ControllerPrefix { get; }

Property Value

string

The route prefix, if any, defined by the controller.

InlineConstraintResolver

Gets the inline constraint resolver.

public IInlineConstraintResolver InlineConstraintResolver { get; }

Property Value

IInlineConstraintResolver

The inline constraint resolver.

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 string

The 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 string

The route template.

constraintResolver IInlineConstraintResolver

The inline constraint resolver to use, if any; otherwise, null.

Returns

IDirectRouteBuilder

A route builder that can build a route matching this context.