Whenever I update an entity, I need to include every field in the form as a hidden input, so that it's value doesn't get set to null
.
Setting the property as not modified, like the code below, prevent this. But this code is abstracted into a generic IRepository
interface encapsulated by an UnitOfWork
class, so I can't specify non-modified properties for each entity.
Entry(entry.Entity as MyModel).Property(e => e.AProperty).IsModified = false;
Is there another way to do that?