Session : How to Ignore Entity Changes
In order to mark an entity as one that should be ignored for change tracking purposes, use the
IgnoreChangesFor method from
Advanced session operations.
Evict method, performing another
Load of that entity won't create a call to the server.
The entity will still take part in the session, but will be ignored for
void IgnoreChangesFor(object entity);
|entity||object||Instance of entity for which changes will be ignored.|
Employee employee = session.Load<Employee>("employees/1-A"); session.Advanced.IgnoreChangesFor(employee); employee.Age += 1; //this will be ignored for SaveChanges session.SaveChanges();