MvcApplicationBuilderExtensions.UseMvc 方法

定义

重载

UseMvc(IApplicationBuilder)

将 MVC 添加到 IApplicationBuilder 请求执行管道。

UseMvc(IApplicationBuilder, Action<IRouteBuilder>)

将 MVC 添加到 IApplicationBuilder 请求执行管道。

UseMvc(IApplicationBuilder)

Source:
MvcApplicationBuilderExtensions.cs
Source:
MvcApplicationBuilderExtensions.cs
Source:
MvcApplicationBuilderExtensions.cs

将 MVC 添加到 IApplicationBuilder 请求执行管道。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseMvc(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseMvc (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseMvc : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseMvc (app As IApplicationBuilder) As IApplicationBuilder

参数

返回

完成操作后对此实例的引用。

注解

此方法仅支持属性路由。 若要添加传统路由,请使用 UseMvc(IApplicationBuilder, Action<IRouteBuilder>)

适用于

UseMvc(IApplicationBuilder, Action<IRouteBuilder>)

Source:
MvcApplicationBuilderExtensions.cs
Source:
MvcApplicationBuilderExtensions.cs
Source:
MvcApplicationBuilderExtensions.cs

将 MVC 添加到 IApplicationBuilder 请求执行管道。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseMvc(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Action<Microsoft::AspNetCore::Routing::IRouteBuilder ^> ^ configureRoutes);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseMvc (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Action<Microsoft.AspNetCore.Routing.IRouteBuilder> configureRoutes);
static member UseMvc : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Routing.IRouteBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseMvc (app As IApplicationBuilder, configureRoutes As Action(Of IRouteBuilder)) As IApplicationBuilder

参数

configureRoutes
Action<IRouteBuilder>

用于配置 MVC 路由的回调。

返回

完成操作后对此实例的引用。

适用于