I have a website where I use fluentNhibernate and Asp.net MVC. I have an editing view that allows the user to edit 8 out of 10 properties for this record (object). When you submit the form and model bindings, two non-editable fields are returned to the view model as empty lines or as the default DateTime values, depending on the type of property.
Since I also use AutoMapper to map my view model to my domain entity, I cannot just download a new copy of my object from the database and manually set two missing properties. What is the best way to save those fields that I don't want to edit?
One way to work is to store values ββin hidden input fields in my view. It works, but it seems rude. I appreciate any advice. Is there a way in AutoMapper to configure this desired feature?
UPDATE: So, I think I am not trying to ignore the fields, I am trying to make sure that I do not store null or empty row values. Ignoring fields in AutoMapper does just that, they are ignored and null when I try to match them before saving to my repository.
asp.net-mvc viewmodel mvvm fluent-nhibernate automapper
shanabus
source share