title: .NET Core web API: one controller is working but the other one is not
body: <p>I am working on a .net core web API project. I have two controllers and they have the same structure. However one of them is working but the other one is giving 404 error.</p>
  <p>My code snippets are follows:</p>
  <pre><code>//mvc routing in the Configure method in the startup class
  app.UseMvc(routes =&gt;
  {
      routes.MapRoute(name: &quot;default&quot;, template: &quot;api/{controller}/{action}/{id?}&quot;);
  });
  </code></pre>
  <p>and my controllers are:</p>
  <pre><code>[Route(&quot;api/user&quot;)]
  public class ManagerController : Controller
  {
      //this is working
      [HttpGet(&quot;myitems/{id}&quot;)]
      public IActionResult GetItems(String id){...}
  }
  
  ../api/user/myitems/123 is working
  
  
  [Route(&quot;api/price&quot;)]
  public class HistController : Controller
  {
  
      //this is not working !!!
      [HttpGet(&quot;item/{id}&quot;)]
      private IActionResult GetItemPrice(String id) {...}
  }
  
  ../api/price/item/123 is not working! (404 error)
  </code></pre>
  <p>Can you please suggest a solution?</p>