Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Added UseMvcWithDefaultRoute extension to BuilderExtensions #2410

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Microsoft.AspNet.Mvc/BuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ public static IApplicationBuilder UseMvc([NotNull] this IApplicationBuilder app)
});
}

/// <summary>
/// Adds Mvc to the <see cref="IApplicationBuilder"/> request execution pipeline
/// with a default route.
/// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
/// <returns>The <paramref name="app"/>.</returns>
public static IApplicationBuilder UseMvcWithDefaultRoute([NotNull] this IApplicationBuilder app)
{
return app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}

/// <summary>
/// Adds Mvc to the <see cref="IApplicationBuilder"/> request execution pipeline.
/// </summary>
Expand Down