ControllerEndpointRouteBuilderExtensions.MapFallbackToController Method

Definition

Overloads

MapFallbackToController(IEndpointRouteBuilder, String, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a controller endpoint that matches action, and controller.

MapFallbackToController(IEndpointRouteBuilder, String, String, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a controller endpoint that matches action, and controller.

MapFallbackToController(IEndpointRouteBuilder, String, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a controller endpoint that matches action, and controller.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToController(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ action, System::String ^ controller);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToController (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string action, string controller);
static member MapFallbackToController : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToController (endpoints As IEndpointRouteBuilder, action As String, controller As String) As IEndpointConventionBuilder

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

action
String

The action name.

controller
String

The controller name.

Returns

IEndpointConventionBuilder

Remarks

MapFallbackToController(IEndpointRouteBuilder, String, String) is intended to handle cases where URL path of the request does not contain a file name, and no other endpoint has matched. This is convenient for routing requests for dynamic content to a SPA framework, while also allowing requests for non-existent files to result in an HTTP 404.

MapFallbackToController(IEndpointRouteBuilder, String, String) registers an endpoint using the pattern {*path:nonfile}. The order of the registered endpoint will be int.MaxValue.

MapFallbackToController(IEndpointRouteBuilder, String, String) does not re-execute routing, and will not generate route values based on routes defined elsewhere. When using this overload, the path route value will be available.

MapFallbackToController(IEndpointRouteBuilder, String, String) does not attempt to disambiguate between multiple actions that match the provided action and controller. If multiple actions match these values, the result is implementation defined.

Applies to

MapFallbackToController(IEndpointRouteBuilder, String, String, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a controller endpoint that matches action, and controller.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToController(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, System::String ^ action, System::String ^ controller);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToController (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, string action, string controller);
static member MapFallbackToController : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * string * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToController (endpoints As IEndpointRouteBuilder, pattern As String, action As String, controller As String) As IEndpointConventionBuilder

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

pattern
String

The route pattern.

action
String

The action name.

controller
String

The controller name.

Returns

IEndpointConventionBuilder

Remarks

MapFallbackToController(IEndpointRouteBuilder, String, String, String) is intended to handle cases where URL path of the request does not contain a file name, and no other endpoint has matched. This is convenient for routing requests for dynamic content to a SPA framework, while also allowing requests for non-existent files to result in an HTTP 404.

The order of the registered endpoint will be int.MaxValue.

This overload will use the provided pattern verbatim. Use the :nonfile route contraint to exclude requests for static files.

MapFallbackToController(IEndpointRouteBuilder, String, String, String) does not re-execute routing, and will not generate route values based on routes defined elsewhere. When using this overload, the route values provided by matching pattern will be available.

MapFallbackToController(IEndpointRouteBuilder, String, String, String) does not attempt to disambiguate between multiple actions that match the provided action and controller. If multiple actions match these values, the result is implementation defined.

Applies to