RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage 方法

定义

重载

MapFallbackToPage(IEndpointRouteBuilder, String)

将专用 RouteEndpoint 化 添加到 IEndpointRouteBuilder ,它将匹配具有尽可能低优先级的非文件名的请求。 请求将路由到与 匹配 page的页面终结点。

MapFallbackToPage(IEndpointRouteBuilder, String, String)

将专用 RouteEndpoint 化 添加到 IEndpointRouteBuilder ,它将匹配具有尽可能低优先级的非文件名的请求。 请求将路由到与 匹配 page的页面终结点。

MapFallbackToPage(IEndpointRouteBuilder, String)

将专用 RouteEndpoint 化 添加到 IEndpointRouteBuilder ,它将匹配具有尽可能低优先级的非文件名的请求。 请求将路由到与 匹配 page的页面终结点。

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

参数

endpoints
IEndpointRouteBuilder

IEndpointRouteBuilder 向其添加路由的 。

page
String

页名称。

返回

注解

MapFallbackToPage(IEndpointRouteBuilder, String) 用于处理请求的 URL 路径不包含文件名且没有其他终结点匹配的情况。 这便于将动态内容的请求路由到 SPA 框架,同时允许对不存在的文件的请求导致 HTTP 404。

MapFallbackToPage(IEndpointRouteBuilder, String) 使用模式 {*path:nonfile}注册终结点。 已注册终结点的顺序将为 int.MaxValue

MapFallbackToPage(IEndpointRouteBuilder, String) 不会重新执行路由,也不会基于其他位置定义的路由生成路由值。 使用此重载时, path 路由值将可用。

适用于

MapFallbackToPage(IEndpointRouteBuilder, String, String)

将专用 RouteEndpoint 化 添加到 IEndpointRouteBuilder ,它将匹配具有尽可能低优先级的非文件名的请求。 请求将路由到与 匹配 page的页面终结点。

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

参数

endpoints
IEndpointRouteBuilder

IEndpointRouteBuilder 向其添加路由的 。

pattern
String

路由模式。

page
String

操作名称。

返回

注解

MapFallbackToPage(IEndpointRouteBuilder, String, String) 用于处理请求的 URL 路径不包含文件名且没有其他终结点匹配的情况。 这便于将动态内容的请求路由到 SPA 框架,同时允许对不存在的文件的请求导致 HTTP 404。

已注册终结点的顺序将为 int.MaxValue

此重载将使用提供的 pattern 逐字记录。 使用 :nonfile 路由约束排除对静态文件的请求。

MapFallbackToPage(IEndpointRouteBuilder, String, String) 不会重新执行路由,也不会基于其他位置定义的路由生成路由值。 使用此重载时,匹配 pattern 提供的路由值将可用。

适用于