ControllerEndpointRouteBuilderExtensions.MapFallbackToController 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| MapFallbackToController(IEndpointRouteBuilder, String, String) |
将专用 RouteEndpoint 于 IEndpointRouteBuilder 将匹配非文件名的请求,其优先级最低。 请求将路由到匹配 |
| MapFallbackToController(IEndpointRouteBuilder, String, String, String) |
将专用 RouteEndpoint 于 IEndpointRouteBuilder 将匹配非文件名的请求,其优先级最低。 请求将路由到匹配 |
MapFallbackToController(IEndpointRouteBuilder, String, String)
将专用 RouteEndpoint 于 IEndpointRouteBuilder 将匹配非文件名的请求,其优先级最低。 请求将路由到匹配 action的控制器终结点,以及 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
参数
- endpoints
- IEndpointRouteBuilder
要 IEndpointRouteBuilder 向其添加路由。
- action
- String
操作名称。
- controller
- String
控制器名称。
返回
注解
MapFallbackToController(IEndpointRouteBuilder, String, String) 用于处理请求的 URL 路径不包含文件名且没有匹配其他终结点的情况。 这便于将动态内容的请求路由到 SPA 框架,同时允许对不存在的文件的请求导致 HTTP 404。
MapFallbackToController(IEndpointRouteBuilder, String, String) 使用模式 {*path:nonfile}注册终结点。 已注册的终结点的顺序将为 int.MaxValue。
MapFallbackToController(IEndpointRouteBuilder, String, String) 不会重新执行路由,也不会基于其他位置定义的路由生成路由值。 使用此重载时, path 路由值将可用。
MapFallbackToController(IEndpointRouteBuilder, String, String) 不会尝试消除与提供的 action 和 controller匹配的多个操作之间的歧义。 如果多个操作与这些值匹配,则结果为定义实现。
适用于
MapFallbackToController(IEndpointRouteBuilder, String, String, String)
将专用 RouteEndpoint 于 IEndpointRouteBuilder 将匹配非文件名的请求,其优先级最低。 请求将路由到匹配 action的控制器终结点,以及 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
参数
- endpoints
- IEndpointRouteBuilder
要 IEndpointRouteBuilder 向其添加路由。
- pattern
- String
路由模式。
- action
- String
操作名称。
- controller
- String
控制器名称。
返回
注解
MapFallbackToController(IEndpointRouteBuilder, String, String, String) 用于处理请求的 URL 路径不包含文件名且没有匹配其他终结点的情况。 这便于将动态内容的请求路由到 SPA 框架,同时允许对不存在的文件的请求导致 HTTP 404。
已注册的终结点的顺序将为 int.MaxValue。
此重载将使用提供的 pattern 逐字。
:nonfile使用路由约束排除对静态文件的请求。
MapFallbackToController(IEndpointRouteBuilder, String, String, String) 不会重新执行路由,也不会基于其他位置定义的路由生成路由值。 使用此重载时,匹配提供的 pattern 路由值将可用。
MapFallbackToController(IEndpointRouteBuilder, String, String, String) 不会尝试消除与提供的 action 和 controller匹配的多个操作之间的歧义。 如果多个操作与这些值匹配,则结果为定义实现。