{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/7064","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/7064/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/7064/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/7064/events","html_url":"https://github.com/aspnet/Mvc/issues/7064","id":275108955,"number":7064,"title":"Model binding fails when the posted form data has a key called \"Model\"","user":{"login":"kshyju","id":144469,"avatar_url":"https://avatars0.githubusercontent.com/u/144469?v=4","gravatar_id":"","url":"https://api.github.com/users/kshyju","html_url":"https://github.com/kshyju","followers_url":"https://api.github.com/users/kshyju/followers","following_url":"https://api.github.com/users/kshyju/following{/other_user}","gists_url":"https://api.github.com/users/kshyju/gists{/gist_id}","starred_url":"https://api.github.com/users/kshyju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kshyju/subscriptions","organizations_url":"https://api.github.com/users/kshyju/orgs","repos_url":"https://api.github.com/users/kshyju/repos","events_url":"https://api.github.com/users/kshyju/events{/privacy}","received_events_url":"https://api.github.com/users/kshyju/received_events","type":"User","site_admin":false},"labels":[{"id":188063138,"url":"https://api.github.com/repos/aspnet/Mvc/labels/investigate","name":"investigate","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":{"login":"rynowak","id":1430011,"avatar_url":"https://avatars1.githubusercontent.com/u/1430011?v=4","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"assignees":[{"login":"rynowak","id":1430011,"avatar_url":"https://avatars1.githubusercontent.com/u/1430011?v=4","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},{"login":"dougbu","id":6431421,"avatar_url":"https://avatars1.githubusercontent.com/u/6431421?v=4","gravatar_id":"","url":"https://api.github.com/users/dougbu","html_url":"https://github.com/dougbu","followers_url":"https://api.github.com/users/dougbu/followers","following_url":"https://api.github.com/users/dougbu/following{/other_user}","gists_url":"https://api.github.com/users/dougbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dougbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougbu/subscriptions","organizations_url":"https://api.github.com/users/dougbu/orgs","repos_url":"https://api.github.com/users/dougbu/repos","events_url":"https://api.github.com/users/dougbu/events{/privacy}","received_events_url":"https://api.github.com/users/dougbu/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-11-18T20:51:38Z","updated_at":"2017-11-22T23:33:00Z","closed_at":null,"author_association":"NONE","body":"When submit the form and if the form data has an item with key `Model`, Model binding is failing.\r\n\r\nFor example, let's say i have a view model like this and  I use that class as the param of my http post action method.\r\n\r\n    public class ModelBinderTestViewModel\r\n    {\r\n        public string Name { set; get; }\r\n        public string Model { set; get; }\r\n    }\r\nand if i am sending form data like this from my form\r\n`\r\nName=Shyju`\r\n\r\nModel binding works, but when i send \r\n\r\n```\r\nName:Shyju\r\nModel:Honda\r\n```\r\n\r\nModel binding does not work now.\r\n\r\n[Here ](https://github.com/kshyju/TempDataBug/blob/master/TempData/Views/ModelBinderTest/Index.cshtml)is the link to a minimal sample repo where you can see this issue . Just run the sample app and submit the form and you will see the results in the next view.\r\n\r\nIs this a know issue ? If yes, Is there some sort of documentation to advise users to not use `Model` as a property name.\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/346500696","html_url":"https://github.com/aspnet/Mvc/issues/7064#issuecomment-346500696","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/7064","id":346500696,"user":{"login":"dougbu","id":6431421,"avatar_url":"https://avatars1.githubusercontent.com/u/6431421?v=4","gravatar_id":"","url":"https://api.github.com/users/dougbu","html_url":"https://github.com/dougbu","followers_url":"https://api.github.com/users/dougbu/followers","following_url":"https://api.github.com/users/dougbu/following{/other_user}","gists_url":"https://api.github.com/users/dougbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dougbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougbu/subscriptions","organizations_url":"https://api.github.com/users/dougbu/orgs","repos_url":"https://api.github.com/users/dougbu/repos","events_url":"https://api.github.com/users/dougbu/events{/privacy}","received_events_url":"https://api.github.com/users/dougbu/received_events","type":"User","site_admin":false},"created_at":"2017-11-22T23:33:00Z","updated_at":"2017-11-22T23:33:00Z","author_association":"MEMBER","body":"The [documentation](https://docs.microsoft.com/en-us/aspnet/core/), especially the [How Model Binding Works](https://docs.microsoft.com/en-us/aspnet/core/mvc/models/model-binding#how-model-binding-works) sub-section, does describe how request names and values are bound to c# properties. However, the implications of the naming details are not thoroughly spelled out. We thus see a fair number of issues like this one.\r\n\r\nThe workaround could also be called out in the API Reference e.g. the [`[ModelBinder] documentation`](https://docs.microsoft.com/en-ca/dotnet/api/microsoft.aspnetcore.mvc.modelbinderattribute?view=aspnetcore-2.0). Right now, the [`[ModelBinder(Name = \"...\")]` details] are only boilerplate."}}
{"actor":{"display_login":"dougbu"}}