ControllerEndpointRouteBuilderExtensions.MapFallbackToController 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| MapFallbackToController(IEndpointRouteBuilder, String, String) |
在 中RouteEndpoint加入一個專用IEndpointRouteBuilder碼,能將非檔案名稱的請求匹配到最低優先順序。 請求會被路由到一個與 、 和 相符 |
| MapFallbackToController(IEndpointRouteBuilder, String, String, String) |
在 中RouteEndpoint加入一個專用IEndpointRouteBuilder碼,能將非檔案名稱的請求匹配到最低優先順序。 請求會被路由到一個與 、 和 相符 |
MapFallbackToController(IEndpointRouteBuilder, String, String)
在 中RouteEndpoint加入一個專用IEndpointRouteBuilder碼,能將非檔案名稱的請求匹配到最低優先順序。 請求會被路由到一個與 、 和 相符actioncontroller的控制器端點。
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) 不嘗試消除多個與所提供 actioncontroller與 相符的動作之間的歧義。 若多個動作符合這些值,則為實作定義。
適用於
MapFallbackToController(IEndpointRouteBuilder, String, String, String)
在 中RouteEndpoint加入一個專用IEndpointRouteBuilder碼,能將非檔案名稱的請求匹配到最低優先順序。 請求會被路由到一個與 、 和 相符actioncontroller的控制器端點。
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) 不嘗試消除多個與所提供 actioncontroller與 相符的動作之間的歧義。 若多個動作符合這些值,則為實作定義。