title: Web Api Core 2 distinguishing GETs
body: <p>Why can't Web API Core 2 tell these apart? </p>
  
  <pre><code>    [HttpGet]
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
      // GET api/values?name=dave
      [HttpGet]
      public string Get(string name)
      {
          return $"name is {name}";
      }
  </code></pre>
  
  <p>Here's what happens - </p>
  
  <p>Both <code>http://localhost:65528/api/values</code> and <code>http://localhost:65528/api/values?name=dave</code> cause the first <code>Get()</code> method to execute. </p>
  
  <p>This exact code works fine in Web Api 2.</p>
  
  <p>I <a href="http://nodogmablog.bryanhogan.net/2017/07/net-core-web-api-routing/" rel="nofollow noreferrer">know</a> <a href="http://nodogmablog.bryanhogan.net/2017/08/net-core-multiple-get-methods-with-the-action-method-selector-attribute/" rel="nofollow noreferrer">multiple</a> ways of getting around this, but I don't know <em>why</em> it happens. </p>
  
  <p>Can someone explain why this has changed?</p>