I have a question about these two ways of specifying whether an entity has been modified. I usually use DbEntityEntry.State
with EntityState.Modified
when I make a very big change in the model and I want all of them to be persisted in the database, and I use #
So assuming I have a model and I update several properties of it (but not all) during a process. Then it marks the model (and not the modified properties) as DbPropertyEntry.IsModified
through the true
property.
When I apply the changes through EntityState.Modified
will all the properties of the model be updated in the database or only those that have been modified? Will an UPDATE SQL command be generated that will include all the model fields in the update?