Get Time Series Names
-
Use
Advanced.GetTimeSeriesForto get the names of all time series for the specified entity. -
In this page:
GetTimeSeriesFor usage
Flow:
- Open a session.
- Load an entity to the session either using session.Load
or by querying for the document via session.Query.
In both cases, the resulting entity will be tracked by the session. - Call
Advanced.GetTimeSeriesFor, pass the tracked entity.
Note:
- If the entity is Not tracked by the session, an
ArgumentExceptionexception is thrown.
Example
// Open a session
using (var session = store.OpenSession())
{
// Load a document entity to the session
User user = session.Load<User>("users/john");
// Call GetTimeSeriesFor, pass the entity
List<string> tsNames = session.Advanced.GetTimeSeriesFor(user);
// Results will include the names of all time series associated with document 'users/john'
}
Syntax
List<string> GetTimeSeriesFor<T>(T instance);
| Parameter | Type | Description |
|---|---|---|
| instance | T | The entity whose time series names you want to get. |
| Return value | |
|---|---|
List<string> | A list of names of all the time series associated with the entity, sorted alphabetically by the name. |