Overriding updatecollection in defaultmodelbinder
I'm having a problem with开发者_JS百科 the DefaultModelBinder
creating new entities when I bind a entity with child collection rather than updating the existing child entities. I found what looks like a good solution in this post but I don't want to have to change the MVC source. Can someone tell me how I could override this method in my project so that my custom UpdateCollection
is always called over the default?
You don't need to change the mvc source. If overriding DefaultModelBinder doesn't work for you, you can take only its sources to your project and the assign default model binder to be your modified one (ModelBinders.Binders.DefaultBinder = new MyOwnModelBinder();).
精彩评论