title: ASP.NET WebAPI 2 Versioning POST with id
body: <p>I'm trying to implement the 'Microsoft.AspNet.WebApi.Versioning' nuget in an existing productive WebAPI 2 application to support new designed 'v2' controllers.</p>
  
  <p>So far everything works fine with the most controllers but now I ran into trouble with some POST controllers.</p>
  
  <p>Sample code:</p>
  
  <pre><code>using Microsoft.Web.Http;
  using System.Web.Http;
  
  namespace ApplicationApi.Controllers
  {
      [ApiVersion("1.0")]
      [Route("api/version")]
      public class VersionController : ApiController
      {
          //Works
          [HttpGet]
          public IHttpActionResult Get()
          {
              return Ok(true);
          }
  
          //Throws  HTTP 405 - The requested resource with API version '1.0' does not support HTTP method 'POST'.
          [HttpPost]
          public IHttpActionResult Post(int id, [FromBody]dynamic value)
          {
              return Ok(true);
          }
  
          //Works
          [HttpPost]
          public IHttpActionResult Post([FromBody]dynamic value)
          {
              return Ok(true);
          }
      }
  }
  </code></pre>
  
  <p>All POST methods without the additional {id} work. But since we have a huge amount old clients for a long time I've to keep the old version up and running and it is not an option to remove the {id} in the old controllers. In the new controllers there is no need for the {id}.</p>
  
  <p>WebAPI config</p>
  
  <pre><code>var constraintResolver = new DefaultInlineConstraintResolver()
  {
      ConstraintMap =
      {
          ["apiVersion"] = typeof( ApiVersionRouteConstraint )
      }
  };
  config.MapHttpAttributeRoutes(constraintResolver);
  
  config.AddApiVersioning(options =&gt;
  {
      options.AssumeDefaultVersionWhenUnspecified = true;
  });
  
  config.Routes.MapHttpRoute(
      name: "DefaultApi",
      routeTemplate: "api/{controller}/{id}",
      defaults: new { id = RouteParameter.Optional }
  );
  </code></pre>
  
  <p>Any idea what I'm doing wrong or how to workaround this?</p>