Is there a easy way of checking a view model(Not Domain Model) for modifications in the post back?
public ActionResult Billing()
{
var viewModel = new BillingViewModel();
viewModel.prop1 = DomainService.Prop1 // Map Domain model to View Model
return View(viewModel);
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Billing(BillingViewModel viewModel)
{
//TODO: Check if ViewModel has changes and save to Domain Repository if valid
if (ValidateBillingViewModel(viewModel))
{
My homebrew solution would be to store a hash of model in hidden field and check it again, but is there a better option?