.GetType().GetProperties() returns properties in different order

自作多情 提交于 2019-11-29 16:42:08

You cannot make any assumption about the order of return values of Type.GetProperties, see what documentation says:

The GetProperties method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies.

If you want an specific order, you should make your code order the collection returned.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!