https://github.com/filipw/strathweb.routeconventions.aspnetcore
https://github.com/filipw/strathweb.routeconventions.aspnetcore
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/filipw/strathweb.routeconventions.aspnetcore
- Owner: filipw
- License: mit
- Created: 2016-06-08T18:05:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-01T16:40:26.000Z (over 7 years ago)
- Last Synced: 2025-01-28T15:15:45.748Z (4 months ago)
- Language: C#
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 📢 IMPORTANT 📢 This feature has been added to [WebApiContrib.Core](https://github.com/WebApiContrib/WebAPIContrib.Core)
# Strathweb.RouteConventions.AspNetCore
ASP.NET Core MVC application model convention allowing you to specify a global route prefix that will be applied implicitly on every controller.
## Usage
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(opt =>
{
// now each route on every controller gets an "api" prefix
opt.UseCentralRoutePrefix(new RouteAttribute("api"));
});
}
## Further readingMore info and background - [in a blog post](http://www.strathweb.com/2016/06/global-route-prefix-with-asp-net-core-mvc-revisited/)