title: MVC5 routing namespace prioritize
body: <p>In MVC5 routing I need one situation. I have 2 namespaces with same controller name. I want to dynamically chose between controllers without conflict</p>
  
  <pre><code>routes.MapRoute(
                  "Default", // Route name
                  "{controller}/{action}/{id}",
                  new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                  new[] { "Namespace1","Namespace2" });
  </code></pre>
  
  <p>In here if there are 2 controllers with same name and actions under both namespaces it gives conflict error. What I want to do is <strong>prioritize</strong> namespaces. </p>
  
  <p>If both namespaces has Home.Index action I want Namespace1 take the lead instead of error. 
  If namespace1 does not have the action I want system check for Namespace2.</p>
  
  <p>I tried few ways but I don't want to use attribute routing better architecture.</p>
  
  <p>We have a BaseECommerce asp.net mvc project and UI projects that are taking inherit of BaseEcommerce project. Purpose is if there is same Controller and Action in UI project use that. Else use base project.</p>
  
  <p>Thanks for help.</p>