Before I ask a question I should say that; All routes have been added to the controllers by Route
attribute. It's not a duplicate of this or this. Because ID parameter (integer type) is passed to the two different functions in this case.
There are two classes and two functions that all seperated in different class. HomeController.AppPage
and BlogController.Detail
functions conflicts when this page localhost:11111/Blog/this-is-blog-title/1
is navigated. I want to run Second One as I stated below.
In the Second One, Blog
segment must be stable in the beginning of the route. I don't want to change or remove.
Thank you for your suggestion and help.
First One
public class HomeController : BaseController
[Route("{title}/{ID}")] // -> No problem with this
[Route("{title1}/{title2}/{ID}")] // -> Conflicting attribute
public ActionResult AppPage(int ID)
{
// Some Code
return View();
}
}
Second One
public class BlogController : BaseController
[Route("Blog/{title}/{ID}")] // -> Conflicting attribute
public ActionResult Detail(int ID)
{
// Some Code
return View();
}
}