Pro ASP.NET MVC 5 By Adam Freeman by Unknown

Pro ASP.NET MVC 5 By Adam Freeman by Unknown

Author:Unknown
Format: epub


Enabling and Applying Attribute Routing

Attribute routing is disabled by default and is enabled by the MapMvcAttributeRoutes extension method, which is called on the RouteCollection object passed as the argument to the static RegisterRoutes method. I have added this method call to the RouteConfig.cs file in Listing 15-35, as well as simplifying the routes in the application so that I can focus on using attributes.

Listing 15-35. Enabling Attribute Routing in the RouteConfig.cs File

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

using System.Web.Routing;

using UrlsAndRoutes.Infrastructure;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.