Best Practices when Implementing IModelBinder [closed]

旧街凉风 提交于 2019-11-30 02:57:13

I inherited from DefaultModelBinder, because it automatically binds basic properties in entity. I enhanced it, so it binds also navigation properties. My binder performs inherited binding first and then searches for additional, navigation property values in form. I think that Your approach should depend on what You really want to do. You can also use reflector and see what really stands behind default binder. This may convince You to inherit.

Travis Illig recently wrote a really good blog article about data type validation when creating a custom model binder.

I've never seen this advice before and I thought it was really good - so I wanted to contribute this link: http://www.paraesthesia.com/archive/2012/01/31/data-type-validation-and-model-binding-in-asp-net-mvc.aspx

MVC Futures 2 has an extensible model binding system. You can find out more in the release documentation at http://aspnet.codeplex.com/releases/view/41742

Just download "ASP.NET MVC 2 Futures Extensible Model Binder Documentation"

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