title: WebAPI Core routing issues
body: <p>So, I am playing around with Web API (ASP.NET Core 2) and having routing issues.</p>
  
  <p>I have several controllers such as:</p>
  
  <p>SchoolController<br>
  TeacherController.</p>
  
  <p>Both have Gets: <code>Get(int id)</code></p>
  
  <p>Problem is that when I run it, I get a runtime error before even actually being able to invoke the methods.</p>
  
  <pre class="lang-none prettyprint-override"><code>Attribute routes with the same name 'Get' must have the same template:
  Action: MyProject.WebAPI.Controllers.SchoolController.Get (MyProject.WebAPI)' - Template: 'api/school/{id}'
  Action: MyProject.WebAPI.Controllers.TeacherController.Get (MyProject.WebAPI)' - Template: 'api/teacher/{id}'
  </code></pre>
  
  <p>Why would it do this when the controllers should have their own Gets etc... so you can do:</p>
  
  <pre><code>/api/{controller}/1
  
  etc... ?
  </code></pre>
  
  <p>Now, I also have another Get method, both in their controllers but with a different method signature along with a different HttpGet name i.e:</p>
  
  <pre><code>// TeachersController:
  
  [Produces("application/json")]
  [Route("api/teacher")]
  public class TeacherController : Controller
  {
  
      // GET: api/Teacher/5
      [HttpGet("{id}", Name = "Get")]
      public IActionResult Get(int id)
      {
  
          // BLAH
      }
  }
  </code></pre>
  
  <p>And for the school controller:</p>
  
  <pre><code>[Produces("application/json")]
  [Route("api/school")]
  public class SchoolController : Controller
  {
  
      [HttpGet("{id}", Name = "Get")]
      public IActionResult Get(int id)
      {
          // BLAH
      }
  
      [HttpGet("SearchBasic")]
      public IActionResult SearchBasic(string schoolName, string zipCode)
      {
          // BLAH
      }
  }
  </code></pre>
  
  <p>To be clear - the question is:</p>
  
  <ul>
  <li><p>Why do I get the runtime errors as soon as the web app is started?</p></li>
  <li><p>The get's are on different controllers, so why would there be any conflicts?</p></li>
  </ul>