MvcApplicationBuilderExtensions Class¶
Extension methods for Microsoft.AspNetCore.Builder.IApplicationBuilder
to add MVC to the request execution pipeline.
- Namespace
Microsoft.AspNetCore.Builder
- Assemblies
- Microsoft.AspNetCore.Mvc.Core
Syntax¶
public class MvcApplicationBuilderExtensions
-
class
Microsoft.AspNetCore.Builder.
MvcApplicationBuilderExtensions
Methods¶
-
UseMvc
(Microsoft.AspNetCore.Builder.IApplicationBuilder)¶ Adds MVC to the
Microsoft.AspNetCore.Builder.IApplicationBuilder
request execution pipeline.Arguments: app (Microsoft.AspNetCore.Builder.IApplicationBuilder) – The Microsoft.AspNetCore.Builder.IApplicationBuilder
.Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder Returns: A reference to this instance after the operation has completed. public static IApplicationBuilder UseMvc(this IApplicationBuilder app)
-
UseMvc
(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Action<Microsoft.AspNetCore.Routing.IRouteBuilder>) Adds MVC to the
Microsoft.AspNetCore.Builder.IApplicationBuilder
request execution pipeline.Arguments: - app (Microsoft.AspNetCore.Builder.IApplicationBuilder) – The
Microsoft.AspNetCore.Builder.IApplicationBuilder
. - configureRoutes (System.Action<Microsoft.AspNetCore.Routing.IRouteBuilder>) – A callback to configure MVC routes.
Return type: Returns: A reference to this instance after the operation has completed.
public static IApplicationBuilder UseMvc(this IApplicationBuilder app, Action<IRouteBuilder> configureRoutes)
- app (Microsoft.AspNetCore.Builder.IApplicationBuilder) – The
-
UseMvcWithDefaultRoute
(Microsoft.AspNetCore.Builder.IApplicationBuilder)¶ Adds MVC to the
Microsoft.AspNetCore.Builder.IApplicationBuilder
request execution pipeline with a default route named ‘default’ and the following template: ‘{controller=Home}/{action=Index}/{id?}’.Arguments: app (Microsoft.AspNetCore.Builder.IApplicationBuilder) – The Microsoft.AspNetCore.Builder.IApplicationBuilder
.Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder Returns: A reference to this instance after the operation has completed. public static IApplicationBuilder UseMvcWithDefaultRoute(this IApplicationBuilder app)
-