ModelBinder validation breaks on getter using reflection

不问归期 提交于 2019-12-01 14:15:31

As a general rule you should avoid using complex classes like PropertyInfos that have properties with other complex types...in classes used for model binding, but you should use just simple classes that contains JUST THE PROPERTIES you need for the model binding process, moreover the whole object graph should contain no loops. Model binding process analyze the type of properties for different purposes (validation attributes, etc.) an i may recusrively analyze the sub-properties of contained in the type of eac property...so complex .net classes containing loops and a lot of other .net types may break it. Try making the property PropertyInfos internal or turn it into a method so it shgould not be processed, by any model binder component.

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