{"action":"opened","issue":{"url":"https://api.github.com/repos/OData/WebApi/issues/1544","repository_url":"https://api.github.com/repos/OData/WebApi","labels_url":"https://api.github.com/repos/OData/WebApi/issues/1544/labels{/name}","comments_url":"https://api.github.com/repos/OData/WebApi/issues/1544/comments","events_url":"https://api.github.com/repos/OData/WebApi/issues/1544/events","html_url":"https://github.com/OData/WebApi/issues/1544","id":343416420,"node_id":"MDU6SXNzdWUzNDM0MTY0MjA=","number":1544,"title":"ASP.NET Core using attribute routing have no effect","user":{"login":"Loongle","id":7290992,"node_id":"MDQ6VXNlcjcyOTA5OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/7290992?v=4","gravatar_id":"","url":"https://api.github.com/users/Loongle","html_url":"https://github.com/Loongle","followers_url":"https://api.github.com/users/Loongle/followers","following_url":"https://api.github.com/users/Loongle/following{/other_user}","gists_url":"https://api.github.com/users/Loongle/gists{/gist_id}","starred_url":"https://api.github.com/users/Loongle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Loongle/subscriptions","organizations_url":"https://api.github.com/users/Loongle/orgs","repos_url":"https://api.github.com/users/Loongle/repos","events_url":"https://api.github.com/users/Loongle/events{/privacy}","received_events_url":"https://api.github.com/users/Loongle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-22T15:47:54Z","updated_at":"2018-07-22T15:47:54Z","closed_at":null,"author_association":"NONE","body":"I see the [documentation ](http://odata.github.io/WebApi/#03-03-attrribute-routing)for building applications in ASP.NET CORE. But it doesn't seem to work. the document describes the code used in the.net Framework.\r\nThe way I use it in the Controller is as follows:\r\n```\r\npublic class UserController : Controller\r\n{\r\n        [ODataRoute(\"User({id})/Roles\")]\r\n        public async Task<IActionResult> GetRoles([FromODataUri] string id)\r\n        {\r\n            if (!ModelState.IsValid)\r\n            {\r\n                return BadRequest(ModelState);\r\n            }\r\n            var user = await _userManager.FindByIdAsync(id);\r\n            if (user == null)\r\n            {\r\n                return NotFound();\r\n            }\r\n\r\n            var roles = await _userManager.GetRolesAsync(user);\r\n\r\n            return Ok(roles);\r\n        }  \r\n}\r\n```\r\n\r\nThere are no more USES cases for asp.net core.\r\nAfter all, documents refer to the previous.net framework\r\nThanks "}}
{"actor":{"display_login":"Loongle"}}