You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

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 the Advanced session operations.

Unlike the 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 SaveChanges.


void IgnoreChangesFor(object entity);
entity object Instance of entity for which changes will be ignored.


Product product = session.Load<Product>("products/1-A");
product.UnitsInStock += 1; //this will be ignored for SaveChanges