共用方式為


MvcApplicationBuilderExtensions.UseMvc 方法

定義

多載

UseMvc(IApplicationBuilder)

將 MVC 新增至 IApplicationBuilder 要求執行管線。

UseMvc(IApplicationBuilder, Action<IRouteBuilder>)

將 MVC 新增至 IApplicationBuilder 要求執行管線。

UseMvc(IApplicationBuilder)

來源:
MvcApplicationBuilderExtensions.cs
來源:
MvcApplicationBuilderExtensions.cs
來源:
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>)

來源:
MvcApplicationBuilderExtensions.cs
來源:
MvcApplicationBuilderExtensions.cs
來源:
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 路由的回呼。

傳回

完成作業之後,這個執行個體的參考。

適用於