{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/issues/18","repository_url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning","labels_url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/issues/18/comments","events_url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/issues/18/events","html_url":"https://github.com/Microsoft/aspnet-api-versioning/issues/18","id":176868400,"number":18,"title":"ASP.Net Core: internal routing fails with CreatedAtRoute","user":{"login":"maerlin","id":11610660,"avatar_url":"https://avatars.githubusercontent.com/u/11610660?v=3","gravatar_id":"","url":"https://api.github.com/users/maerlin","html_url":"https://github.com/maerlin","followers_url":"https://api.github.com/users/maerlin/followers","following_url":"https://api.github.com/users/maerlin/following{/other_user}","gists_url":"https://api.github.com/users/maerlin/gists{/gist_id}","starred_url":"https://api.github.com/users/maerlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maerlin/subscriptions","organizations_url":"https://api.github.com/users/maerlin/orgs","repos_url":"https://api.github.com/users/maerlin/repos","events_url":"https://api.github.com/users/maerlin/events{/privacy}","received_events_url":"https://api.github.com/users/maerlin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/labels/bug","name":"bug","color":"ee0701"}],"state":"open","locked":false,"assignee":{"login":"commonsensesoftware","id":11765008,"avatar_url":"https://avatars.githubusercontent.com/u/11765008?v=3","gravatar_id":"","url":"https://api.github.com/users/commonsensesoftware","html_url":"https://github.com/commonsensesoftware","followers_url":"https://api.github.com/users/commonsensesoftware/followers","following_url":"https://api.github.com/users/commonsensesoftware/following{/other_user}","gists_url":"https://api.github.com/users/commonsensesoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/commonsensesoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commonsensesoftware/subscriptions","organizations_url":"https://api.github.com/users/commonsensesoftware/orgs","repos_url":"https://api.github.com/users/commonsensesoftware/repos","events_url":"https://api.github.com/users/commonsensesoftware/events{/privacy}","received_events_url":"https://api.github.com/users/commonsensesoftware/received_events","type":"User","site_admin":false},"assignees":[{"login":"commonsensesoftware","id":11765008,"avatar_url":"https://avatars.githubusercontent.com/u/11765008?v=3","gravatar_id":"","url":"https://api.github.com/users/commonsensesoftware","html_url":"https://github.com/commonsensesoftware","followers_url":"https://api.github.com/users/commonsensesoftware/followers","following_url":"https://api.github.com/users/commonsensesoftware/following{/other_user}","gists_url":"https://api.github.com/users/commonsensesoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/commonsensesoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commonsensesoftware/subscriptions","organizations_url":"https://api.github.com/users/commonsensesoftware/orgs","repos_url":"https://api.github.com/users/commonsensesoftware/repos","events_url":"https://api.github.com/users/commonsensesoftware/events{/privacy}","received_events_url":"https://api.github.com/users/commonsensesoftware/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-09-14T10:13:52Z","updated_at":"2016-09-14T14:14:53Z","closed_at":null,"body":"I detected a problem with the routing, if you want to create an object via post and then return a CreatedAtRoute result. It always returns an error 500: \"No route matches the supplied values\"\r\n\r\nIf i remove the package (aspnet-api-versioning), and rename the route of the controller to /api/v1 in a fixed way, it works.\r\n\r\nThe provided samples in this repository are not  (unfortunately ) helping in this case, because there are or only 'GET' request samples.\r\n\r\nCan you help me? If you need more informations, i would be happy to send you some more.\r\n\r\nHere's my code:\r\n\r\n```C#\r\n[ApiVersion(\"1.0\")]\r\n[Route(\"api/v{version:apiVersion}/[Controller]\")]\r\npublic class DocumentController : Controller\r\n{\r\n\r\n[HttpGet(\"{guid}\", Name = \"GetDocument\")]\r\npublic IActionResult GetByGuid(string guid)\r\n{\r\n    var doc = DocumentDataProvider.Find(guid);\r\n    if (doc == null)\r\n        return NotFound();\r\n\r\n    return new ObjectResult(doc) {StatusCode = 200};\r\n}\r\n\r\n\r\n[HttpPost]\r\npublic IActionResult Create([FromBody] Document doc)\r\n{\r\n    //... Creating Doc\r\n\r\n     var newguid = newDoc.Guid.ToString(\"N\");\r\n\r\n    //Does not work\r\n   val = CreatedAtRoute(\"GetDocument\", new{ controller =  \"document\", guid = newguid, version = HttpContext.GetRequestedApiVersion().ToString() }}, newDoc);\r\n\r\n    return val;\r\n}\r\n}\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/issues/comments/247026707","html_url":"https://github.com/Microsoft/aspnet-api-versioning/issues/18#issuecomment-247026707","issue_url":"https://api.github.com/repos/Microsoft/aspnet-api-versioning/issues/18","id":247026707,"user":{"login":"commonsensesoftware","id":11765008,"avatar_url":"https://avatars.githubusercontent.com/u/11765008?v=3","gravatar_id":"","url":"https://api.github.com/users/commonsensesoftware","html_url":"https://github.com/commonsensesoftware","followers_url":"https://api.github.com/users/commonsensesoftware/followers","following_url":"https://api.github.com/users/commonsensesoftware/following{/other_user}","gists_url":"https://api.github.com/users/commonsensesoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/commonsensesoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commonsensesoftware/subscriptions","organizations_url":"https://api.github.com/users/commonsensesoftware/orgs","repos_url":"https://api.github.com/users/commonsensesoftware/repos","events_url":"https://api.github.com/users/commonsensesoftware/events{/privacy}","received_events_url":"https://api.github.com/users/commonsensesoftware/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T14:14:53Z","updated_at":"2016-09-14T14:14:53Z","body":"It might also be worth mentioning that you don't have to re-specify route parameters that are already provided by the current route.\r\n\r\nFor example, the following will work just fine (after the fix):\r\n```c#\r\nCreatedAtRoute( \"GetDocument\", new { guid = newguid }, newDoc );\r\n```\r\nThe **controller** and **version** route parameters are already provided so you don't need to specify them again. There's nothing wrong with your approach, but you can make things more succinct if you want. :)"}}
{"actor":{"display_login":"commonsensesoftware"}}