In the following controller, following is the status of requests:
GET base/about -> prints "About"
GET base/contact-> 404 Not Found (expected as there is explicit Route attribute)
GET base/hello -> prints "Contact"
GET derived/about -> prints "About"
GET derived/contact -> 404 Not Found (this is __not__ expected as Route is not inherited)
```
[Route("base/{action}")]
public class BaseController : Controller
{
[HttpGet]
public ActionResult About()
{
return Content("About");
}
[HttpGet]
[Route("base/hello")]
public virtual ActionResult Contact()
{
return Content("Contact");
}
}
[Route("derived/{action}")]
public class DerivedController : BaseController
{
}
```
GET base/about -> prints "About"
GET base/contact-> 404 Not Found (expected as there is explicit Route attribute)
GET base/hello -> prints "Contact"
GET derived/about -> prints "About"
GET derived/contact -> 404 Not Found (this is __not__ expected as Route is not inherited)
```
[Route("base/{action}")]
public class BaseController : Controller
{
[HttpGet]
public ActionResult About()
{
return Content("About");
}
[HttpGet]
[Route("base/hello")]
public virtual ActionResult Contact()
{
return Content("Contact");
}
}
[Route("derived/{action}")]
public class DerivedController : BaseController
{
}
```