Table of Contents

Class DefaultHttpControllerSelector

Namespace
System.Web.Http.Dispatcher
Assembly
System.Web.Http.dll

Represents a default IHttpControllerSelector instance for choosing a HttpControllerDescriptor given a HttpRequestMessage. A different implementation can be registered via the Services.

public class DefaultHttpControllerSelector : IHttpControllerSelector
Inheritance
DefaultHttpControllerSelector
Implements
Inherited Members

Constructors

DefaultHttpControllerSelector(HttpConfiguration)

Initializes a new instance of the DefaultHttpControllerSelector class.

public DefaultHttpControllerSelector(HttpConfiguration configuration)

Parameters

configuration HttpConfiguration

The configuration.

Fields

ControllerSuffix

Specifies the suffix string in the controller name.

public static readonly string ControllerSuffix

Field Value

string

Methods

GetControllerMapping()

Returns a map, keyed by controller string, of all HttpControllerDescriptor that the selector can select.

public virtual IDictionary<string, HttpControllerDescriptor> GetControllerMapping()

Returns

IDictionary<string, HttpControllerDescriptor>

A map of all HttpControllerDescriptor that the selector can select, or null if the selector does not have a well-defined mapping of HttpControllerDescriptor.

GetControllerName(HttpRequestMessage)

Gets the name of the controller for the specified HttpRequestMessage.

public virtual string GetControllerName(HttpRequestMessage request)

Parameters

request HttpRequestMessage

The HTTP request message.

Returns

string

The name of the controller for the specified HttpRequestMessage.

SelectController(HttpRequestMessage)

public virtual HttpControllerDescriptor SelectController(HttpRequestMessage request)

Parameters

request HttpRequestMessage

The HTTP request message.

Returns

HttpControllerDescriptor

The HttpControllerDescriptor instance for the given HttpRequestMessage.