For example, I have a DateCreated
property on my Product
and ProductDetailModel
classes. Yet, on my Edit view, I have no DateCreated
input, or any kind of storage. When I edit a product with a DateCreateded
of 2013/03/17, the DateCreated
that is posted back in the ProductDetailModel
is always '0001/01/01'. Unless I add a hidden input for every unused field to my edit view, I will always lose this information.
Is there any method of telling which properties in ProductDetailModel
were actually signed values, or are just default values because no form elements exist for them?
Do I have to write my own model binder that maintains, in the view model, a list of updated fields, so that I can only assign these values back to the original object before saving it?