{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/1012","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/1012/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/1012/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/1012/events","html_url":"https://github.com/aspnet/Mvc/issues/1012","id":40323696,"number":1012,"title":"Make `@Html.Display()` and `@Html.Editor()` order properties by name","user":{"login":"dougbu","id":6431421,"avatar_url":"https://avatars.githubusercontent.com/u/6431421?v=3","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},"labels":[{"id":70264664,"url":"https://api.github.com/repos/aspnet/Mvc/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aspnet/Mvc/milestones/9","html_url":"https://github.com/aspnet/Mvc/milestones/Backlog","labels_url":"https://api.github.com/repos/aspnet/Mvc/milestones/9/labels","id":673495,"number":9,"title":"Backlog","description":"Items to be considered in future releases that are currently not assigned any specific milestone.","creator":{"login":"yishaigalatzer","id":1238711,"avatar_url":"https://avatars.githubusercontent.com/u/1238711?v=3","gravatar_id":"","url":"https://api.github.com/users/yishaigalatzer","html_url":"https://github.com/yishaigalatzer","followers_url":"https://api.github.com/users/yishaigalatzer/followers","following_url":"https://api.github.com/users/yishaigalatzer/following{/other_user}","gists_url":"https://api.github.com/users/yishaigalatzer/gists{/gist_id}","starred_url":"https://api.github.com/users/yishaigalatzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yishaigalatzer/subscriptions","organizations_url":"https://api.github.com/users/yishaigalatzer/orgs","repos_url":"https://api.github.com/users/yishaigalatzer/repos","events_url":"https://api.github.com/users/yishaigalatzer/events{/privacy}","received_events_url":"https://api.github.com/users/yishaigalatzer/received_events","type":"User","site_admin":false},"open_issues":196,"closed_issues":55,"state":"open","created_at":"2014-05-28T21:50:24Z","updated_at":"2016-11-15T18:46:24Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2014-08-15T05:25:43Z","updated_at":"2016-11-15T18:46:24Z","closed_at":"2016-11-15T18:46:24Z","body":"MVC 5.2 and (soon, see issue #964 and PR #1010) 6.0 order properties in the `@Html.Display()` and `@Html.Editor()` return values using the `ModelMetadata.Order` property.  This produces as stable an order as Linq's `OrderBy()` -- leaves the properties in their original order.  But the order isn't predictable because the CLR doesn't guarantee an order the `Type.GetRuntimeProperties()` extension method returns properties.\n\nThe point may be moot if `Type.GetRuntimeProperties()` _happens_ to order properties consistently and not by (say) the order they appear in the IL.  But we could ensure a predictable order by adding `ThenBy(m => m.Name)` to our current sort (in the `ModelMetadata.Properties` lazy-init getter)\n\nSome questions:\n- Is this necessary?  That is are properties ordered by name or something equally obvious already?\n- Would the additional sorting have any downsides?  For example performance could be an issue because the `Properties` enumeration isn't initialized in our `ModelMetadata` prototype cache.\n"}}
{"actor":{"display_login":"Eilon"}}