title: Web API routing using RouteAttribute - Multiple actions were found that match the reques
body: <p>In my Web API 2 project I have two POST methods:</p>
  
  <pre><code>[HttpPost]
  public virtual IHttpActionResult Create([FromBody]TDto value) { ... }
  
  [Route("many")]
  [HttpPost]
  public virtual void CreateMany([FromBody]TDto[] value) { ... }
  </code></pre>
  
  <p>My route template looks like this:</p>
  
  <pre><code>config.Routes.MapHttpRoute(name: "DefaultApi", routeTemplate: "api/{controller}")
  </code></pre>
  
  <p>When I make a POST to <a href="http://server/api/Products" rel="nofollow">http://server/api/Products</a> I get the following error: "Multiple actions were found that match the request: Create on type ProductsController, CreateMany on type ProductsController"</p>
  
  <p>Why does the method with the RouteAttribute set to "many" match the route? Shouldn't "many" be a mandatory part of the URL?</p>
  
  <p>When I post to  <a href="http://server/api/Products/many" rel="nofollow">http://server/api/Products/many</a> the correct method is called.</p>
  
  <p>I know I can get around the problem by specifying the Order in the Route-attribute, but I want to understand why this is happening.</p>
  
  <p><strong>Edit</strong>:<br>
  Just found out that if I added an empty route to the Create-method, it works as I want:</p>
  
  <pre><code>[Route("")] // &lt;-- ADDED THIS
  [HttpPost]
  public virtual IHttpActionResult Create([FromBody]TDto value) { ... }
  
  [Route("many")]
  [HttpPost]
  public virtual void CreateMany([FromBody]TDto[] value) { ... }
  </code></pre>
  
  <p>If anyone can explain why this is happening I'm still all ears :-)</p>