My question is basicially the same as the situation presented in this stack overflow question where I find myself wanting to load the existing valid version of model from the DB, and update a portion of it as a certain sub-set of fields are exposed on my web form.
Is there anyway I can make the Model Binding process guarantee that my ID property will be bound first?
If I could guarantee this one thing, then, inside the setter of my ViewModel's ID property, I could trigger a 'load', so that the object is initially populated from the DB (or WCF service.. or Xml file.. or other repository of choice) and then the remaining properties submitted from the FORM post neatly merge into the object as MVC finishes up it's model binding process.
Then, my IValidatableObject.Validate method logic will nicely tell me if the resulting object is still valid.. and so forth and so on..
It just seems to me that having to write plumbing where I have two instances of a model(knownValidDomainModelInstanceFromStorage, postedPartialViewModelInstanceFromForm) and then manually mapping over desired properties is to repeat something that is really already handled by MVC... if I could only control the binding order of the identity.
EDIT - I discovered property binding order CAN be manipulated with a custom binder. Very easily. Read the answer I posted below. Would still welcome your feedback or observations.