views:

104

answers:

1

I'm having a problem with the default model binder 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

link text

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?

A: 

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();).

queen3
I've tried taking the DefaultModelBinder class over on its own but get a lot of inaccessible due to protection level for many of the methods it uses..
Joe