title: ASP.NET Core "CreatedAtRoute" Failure
body: <p>Inside my ASP.NET Core app I have a controller action like this:</p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; CreateSubscriber([FromBody] SubscriberDef subscriber)
  {
      //...implementation removed
  
      var link = Url.Link("SubscriberLink", new { id = subscriber.ID });
          return Created(link, null);
  }
  </code></pre>
  
  <p>The above code works as expected.  However, if I use the built-in method "CreatedAtRoute", then I get an exception:</p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; CreateSubscriber([FromBody] SubscriberDef subscriber)
  {
      //...implementation removed
  
      return CreatedAtRoute("SubscriberLink", new { id = subscriber.ID });
  }
  </code></pre>
  
  <p>The exception is:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: No route matches the supplied values.</p>
  </blockquote>
  
  <p>The exception causes the service to return a 500 status code.</p>
  
  <p>It is the same route in either case, so I don't know why the first example works correctly and the second does not.</p>
  
  <p>My <code>project.json</code> contains this:</p>
  
  <pre><code>"frameworks": {
    "dnx46": { },
    "dnxcore50": { }
  },
  </code></pre>
  
  <p>For reference sake, the named route is composed from two pieces.  First is the controller prefix:</p>
  
  <pre><code>[Route("api/[controller]")]
  public class SubscribersController : Controller
  {
      // ...
  }
  </code></pre>
  
  <p>Second is the GET action, where the actual <code>"SubscriberLink"</code> route is named:</p>
  
  <pre><code>[HttpGet("{id}", Name = "SubscriberLink")]
  [SwaggerResponse(HttpStatusCode.OK, Type = typeof(Subscriber))]
  public async Task&lt;IActionResult&gt; GetSubscriber(Guid id)
  {
      //...implementation removed...
      return Ok(subscriber);
  }
  </code></pre>
  
  <p>Thoughts?</p>