Session : How to Get Entity Change-Vector
The change-vector reflects the cluster wide point in time where something happened. It includes the unique database ID, node identifier, and the Etag of the document in the specific node.
When a document is downloaded from the server, it contains various metadata information e.g. ID or current change-vector. Current change-vector is stored within the metadata in session and is available for each entity using the
GetChangeVectorFor method from the
Advanced session operations.
string GetChangeVectorFor<T>(T instance);
||Instance of an entity for which an Etag will be returned.
||Returns the current change-vector for an entity. If the
instance is transient, it will load the document from the server and attach the entity and its metadata to the session.
Employee employee = session.Load<Employee>("employees/1-A");
string changeVector = session.Advanced.GetChangeVectorFor(employee);