How to Get Entity Counters
When a document is loaded to the session,
the loaded entity will contain various metadata information such as ID, current change-vector, and more.
If the document has Counters, the document metadata will also contain its counter names.
The counter names are available for each entity using the
GetCountersFor()method from the
In this page:
Get entity counters
// Load a document var employee = session.Load<Employee>("employees/1-A"); // Get counter names from the loaded entity List<string> counterNames = session.Advanced.GetCountersFor(employee);
List<string> GetCountersFor<T>(T instance);
|instance||T||Instance of an entity for which counter names will be returned.|
||Returns the counter names for the specified entity, or
An exception is thrown if the