Skip to content
Documentation

ITimeSeriesStore<TIdentifier> Interface

Defines a store used for permanently storing ITimeSeries that can be uniquely identified by a value of type TIdentifier.

public interface ITimeSeriesStore<TIdentifier> : HAKOM.TSM.Net.Api.TimeSeries.Persistence.ITimeSeriesStore, HAKOM.Persistence.Core.Net.Api.Storage.IStore<HAKOM.Persistence.Core.Net.Api.Storage.IStorageProvider>
where TIdentifier : System.IEquatable<TIdentifier>

TIdentifier

The type of the identifier to be used to retrieve specific ITimeSeries.

Derived
↳ ISqlTimeSeriesStore

Implements ITimeSeriesStore, HAKOM.Persistence.Core.Net.Api.Storage.IStore<IStorageProvider>

This interface extends ITimeSeriesStore with methods that allow for the retrieval of individual ITimeSeries by a unique identifier other than their name. For example, a SQL-database based time series store, may allow for retrieval of time series by their numeric primary key or an automatically assigned System.Guid.

In order to use these methods, match the ITimeSeriesStore against this interface with the expected TIdentifier, then call the respective methods.

Note that different implementations may support different types of identifiers and there is no way of knowing which one is supported by the configured store at compile time.

Loading a time series by integer id
int timeSeriesId = 32452;
ITsm tsm = ITsm.Create();
var repository = await tsm.Repositories.GetAll("TestRepository");
var timeSeriesStore = await repository.GetTimeSeriesStore();
if (timeSeriesStore is ITimeSeriesStore<int> integerTimeSeriesStore) {
var timeSeries = await integerTimeSeriesStore.GetAll(timeSeriesId);
} else {
//make sure to always handle this case too!
}

ITimeSeriesStore<TIdentifier>.References Property

Section titled “ITimeSeriesStore<TIdentifier>.References Property”

Used to create references to time series in this store.

HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReferenceFactory<TIdentifier> References { get; }

HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReferenceFactory<TIdentifier>

ITimeSeriesStore<TIdentifier>.Delete(TIdentifier, bool, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.Delete(TIdentifier, bool, CancellationToken) Method”

Deletes a time series from the repository based on the given identifier.

System.Threading.Tasks.Task Delete(TIdentifier identifier, bool cascade=true, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series to be deleted.

cascade System.Boolean

If set to true (default) it also deletes all data referenced to the timeseries.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task
A System.Threading.Tasks.Task.

ITimeSeriesStore<TIdentifier>.Load(TIdentifier, TimeSeriesResultContent, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.Load(TIdentifier, TimeSeriesResultContent, CancellationToken) Method”

Loads a single time series from storage together with the requested content.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference> Load(TIdentifier identifier, HAKOM.TSM.Net.Api.TimeSeries.Persistence.TimeSeriesResultContent content, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series.

content TimeSeriesResultContent

The TimeSeriesResultContent to be returned together with the time series definition.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Threading.Tasks.Task<ITimeSeriesReference>
A Task containing the ITimeSeriesReference.

ITimeSeriesStore<TIdentifier>.Load(TIdentifier, DateTimeOffset, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.Load(TIdentifier, DateTimeOffset, CancellationToken) Method”

Loads a single time series from storage in the state from a specific date and time.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference> Load(TIdentifier identifier, System.DateTimeOffset historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series.

historicDateTime System.DateTimeOffset

Date and time of the state in which the time series is loaded.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Threading.Tasks.Task<ITimeSeriesReference>
A Task containing the ITimeSeries.

ITimeSeriesStore<TIdentifier>.Load(TIdentifier, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.Load(TIdentifier, CancellationToken) Method”

Loads a single time series from storage.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference> Load(TIdentifier identifier, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Threading.Tasks.Task<ITimeSeriesReference>
A Task containing the ITimeSeries.

ITimeSeriesStore<TIdentifier>.LoadAssignment<TAssigned>(TIdentifier, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.LoadAssignment<TAssigned>(TIdentifier, CancellationToken) Method”

Loads a single time series assignment as ITimeSeriesAssignmentReference<TAssigned> from storage.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.Assignment.References.ITimeSeriesAssignmentReference<TAssigned>> LoadAssignment<TAssigned>(TIdentifier identifier, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken))
where TAssigned : HAKOM.TSM.Net.Api.TimeSeries.IAssignableToTimeSeries;

TAssigned

identifier TIdentifier

The TIdentifier identifier of the time series assignment.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.Assignment.References.ITimeSeriesAssignmentReference<TAssigned>>
A System.Threading.Tasks.Task containing the ITimeSeriesAssignmentReference<TAssigned> object.

ITimeSeriesStore<TIdentifier>.LoadBulk(IReadOnlyCollection<TIdentifier>, TimeSeriesResultContent, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.LoadBulk(IReadOnlyCollection<TIdentifier>, TimeSeriesResultContent, CancellationToken) Method”

Loads several time series by their identifiers together with the requested content, yielding one reference per distinct identifier keyed by that identifier.

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TIdentifier,HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>> LoadBulk(System.Collections.Generic.IReadOnlyCollection<TIdentifier> identifiers, HAKOM.TSM.Net.Api.TimeSeries.Persistence.TimeSeriesResultContent content, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifiers System.Collections.Generic.IReadOnlyCollection<TIdentifier>

The TIdentifier ids of the time series.

content TimeSeriesResultContent

The TimeSeriesResultContent to be returned together with the time series definitions.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TIdentifier,ITimeSeriesReference>>
An System.Collections.Generic.IAsyncEnumerable<> of System.Collections.Generic.KeyValuePair<> pairing each distinct identifier with its ITimeSeriesReference.

ITimeSeriesStore<TIdentifier>.SaveOrUpdate(TIdentifier, ITimeSeries, IStorageInformation, DateTimeOffset, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.SaveOrUpdate(TIdentifier, ITimeSeries, IStorageInformation, DateTimeOffset, CancellationToken) Method”

Saves or updates the time series with the given identifier by the given time series.
If no time series with the given identifier was found the time series will be saved or updated based on the time series name.
Further takes information about where its data is stored.
It includes information about the exact point in time, at which the time series was in the given state.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference> SaveOrUpdate(TIdentifier identifier, HAKOM.TSM.Net.Api.TimeSeries.ITimeSeries timeSeries, HAKOM.Persistence.Core.Net.Api.Storage.IStorageInformation dataStorageInformation, System.DateTimeOffset historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The identifier of the time series to update.

timeSeries ITimeSeries

The ITimeSeries to be saved or updated.

dataStorageInformation IStorageInformation

The IStorageInformation the data will be saved on.

historicDateTime System.DateTimeOffset

The System.DateTimeOffset object representing the historic date and time of saving the time series definition.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<ITimeSeriesReference>
A System.Threading.Tasks.Task<> containing a reference to the saved or updated time series.

ITimeSeriesStore<TIdentifier>.SaveOrUpdate(TIdentifier, ITimeSeries, DateTimeOffset, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.SaveOrUpdate(TIdentifier, ITimeSeries, DateTimeOffset, CancellationToken) Method”

Saves or updates the time series with the given identifier by the given time series.
If no time series with the given identifier was found the time series will be saved or updated based on the time series name.
It includes information about the exact point in time, at which the time series was in the given state.

System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference> SaveOrUpdate(TIdentifier identifier, HAKOM.TSM.Net.Api.TimeSeries.ITimeSeries timeSeries, System.DateTimeOffset historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The identifier of the time series to update.

timeSeries ITimeSeries

The ITimeSeries to be saved or updated.

historicDateTime System.DateTimeOffset

The System.DateTimeOffset object representing the historic date and time of saving the time series definition.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<ITimeSeriesReference>
A System.Threading.Tasks.Task<> containing a reference to the saved or updated time series.

ITimeSeriesStore<TIdentifier>.TryDelete(TIdentifier, bool, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TryDelete(TIdentifier, bool, CancellationToken) Method”

Tries to delete a time series from the repository based on the given identifier.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result> TryDelete(TIdentifier identifier, bool cascade=true, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series to be deleted.

cascade System.Boolean

If set to true (default) it also deletes all data referenced to the timeseries.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<Result>
A System.Threading.Tasks.Task<> of Result.

The Result will provide additional information about success or failure.

ITimeSeriesStore<TIdentifier>.TryLoad(TIdentifier, TimeSeriesResultContent, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TryLoad(TIdentifier, TimeSeriesResultContent, CancellationToken) Method”

Loads a single time series from storage together with the requested content.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>> TryLoad(TIdentifier identifier, HAKOM.TSM.Net.Api.TimeSeries.Persistence.TimeSeriesResultContent content, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series.

content TimeSeriesResultContent

The TimeSeriesResultContent to be returned together with the time series definition.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<ITimeSeriesReference>>
A System.Threading.Tasks.Task<> of Result<TValue> containing the ITimeSeriesReference object.

The Result will provide additional information about success or failure.

The default implementation only supports None, where it behaves like TryLoad(TIdentifier, CancellationToken). Any other content fails with an UnexpectedErrorException whose System.Exception.InnerException is a System.NotSupportedException. Implementations of this interface override this overload to provide the content.

ITimeSeriesStore<TIdentifier>.TryLoad(TIdentifier, DateTimeOffset, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TryLoad(TIdentifier, DateTimeOffset, CancellationToken) Method”

Loads a single time series from storage in the state from a specific date and time.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>> TryLoad(TIdentifier identifier, System.DateTimeOffset historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series.

historicDateTime System.DateTimeOffset

Date and time of the state in which the time series is loaded.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<ITimeSeriesReference>>
A System.Threading.Tasks.Task<> of Result<TValue> containing the ITimeSeries object.

The Result will provide additional information about success or failure.

ITimeSeriesStore<TIdentifier>.TryLoad(TIdentifier, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TryLoad(TIdentifier, CancellationToken) Method”

Loads a single time series from storage.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>> TryLoad(TIdentifier identifier, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The TIdentifier id of the time series.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<ITimeSeriesReference>>
A System.Threading.Tasks.Task<> of Result<TValue> containing the ITimeSeries object.

The Result will provide additional information about success or failure.

ITimeSeriesStore<TIdentifier>.TryLoadAssignment<TAssigned>(TIdentifier, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TryLoadAssignment<TAssigned>(TIdentifier, CancellationToken) Method”

Attempts to load a single time series assignment as ITimeSeriesAssignmentReference<TAssigned> from storage.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.Assignment.References.ITimeSeriesAssignmentReference<TAssigned>>> TryLoadAssignment<TAssigned>(TIdentifier identifier, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken))
where TAssigned : HAKOM.TSM.Net.Api.TimeSeries.IAssignableToTimeSeries;

TAssigned

identifier TIdentifier

The TIdentifier identifier of the time series assignment.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.Assignment.References.ITimeSeriesAssignmentReference<TAssigned>>>
A System.Threading.Tasks.Task<> containing the ITimeSeriesAssignmentReference<TAssigned> object.

The Result will provide additional information about success or failure.

ITimeSeriesStore<TIdentifier>.TryLoadBulk(IReadOnlyCollection<TIdentifier>, TimeSeriesResultContent, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TryLoadBulk(IReadOnlyCollection<TIdentifier>, TimeSeriesResultContent, CancellationToken) Method”

Loads several time series by their identifiers together with the requested content, yielding one result per distinct identifier keyed by that identifier.

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TIdentifier,HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>>> TryLoadBulk(System.Collections.Generic.IReadOnlyCollection<TIdentifier> identifiers, HAKOM.TSM.Net.Api.TimeSeries.Persistence.TimeSeriesResultContent content, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifiers System.Collections.Generic.IReadOnlyCollection<TIdentifier>

The TIdentifier ids of the time series.

content TimeSeriesResultContent

The TimeSeriesResultContent to be returned together with the time series definitions.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the read operation.

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TIdentifier,HAKOM.ErrorHandling.Core.Net.Api.Result<ITimeSeriesReference>>>
An System.Collections.Generic.IAsyncEnumerable<> of System.Collections.Generic.KeyValuePair<> pairing each distinct identifier with its Result<TValue>.

Every result is keyed by the identifier as it was requested, and every distinct identifier gets exactly one result, answered as TryLoad(TIdentifier, TimeSeriesResultContent, CancellationToken) answers it. An identifier requested twice gets one result. Results are streamed in completion order, which is not necessarily the order of identifiers.

A failure that belongs to a single time series fails only its own identifier. A failure of the operation as a whole, such as a denied authorization or a broken connection, fails every identifier that has not been answered yet.

The default implementation calls TryLoad(TIdentifier, TimeSeriesResultContent, CancellationToken) for every distinct identifier, one after the other. Implementations of this interface override it to load many identifiers with one query. The SQL stores bind up to 1000 identifiers to one statement and run further statements for the rest.

ITimeSeriesStore<TIdentifier>.TrySaveOrUpdate(TIdentifier, ITimeSeries, IStorageInformation, DateTimeOffset, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TrySaveOrUpdate(TIdentifier, ITimeSeries, IStorageInformation, DateTimeOffset, CancellationToken) Method”

Tries to save or update the time series with the given identifier by the given time series.
If no time series with the given identifier was found the time series will be saved or updated based on the time series name.
Further takes information about where its data is stored.
It includes information about the exact point in time, at which the time series was in the given state.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>> TrySaveOrUpdate(TIdentifier identifier, HAKOM.TSM.Net.Api.TimeSeries.ITimeSeries timeSeries, HAKOM.Persistence.Core.Net.Api.Storage.IStorageInformation dataStorageInformation, System.DateTimeOffset historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The identifier of the time series to update.

timeSeries ITimeSeries

The ITimeSeries to be saved or updated.

dataStorageInformation IStorageInformation

The IStorageInformation the data will be saved on.

historicDateTime System.DateTimeOffset

The System.DateTimeOffset object representing the historic date and time of saving the time series definition.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<ITimeSeriesReference>>
A System.Threading.Tasks.Task<> of Result.

The Result will provide additional information about success or failure.

ITimeSeriesStore<TIdentifier>.TrySaveOrUpdate(TIdentifier, ITimeSeries, DateTimeOffset, CancellationToken) Method

Section titled “ITimeSeriesStore<TIdentifier>.TrySaveOrUpdate(TIdentifier, ITimeSeries, DateTimeOffset, CancellationToken) Method”

Tries to save or update the time series with the given identifier by the given time series.
If no time series with the given identifier was found the time series will be saved or updated based on the time series name.
It includes information about the exact point in time, at which the time series was in the given state.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.TimeSeries.Persistence.References.ITimeSeriesReference>> TrySaveOrUpdate(TIdentifier identifier, HAKOM.TSM.Net.Api.TimeSeries.ITimeSeries timeSeries, System.DateTimeOffset historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

identifier TIdentifier

The identifier of the time series to update.

timeSeries ITimeSeries

The ITimeSeries to be saved or updated.

historicDateTime System.DateTimeOffset

The System.DateTimeOffset object representing the historic date and time of saving the time series definition.

cancellationToken System.Threading.CancellationToken

A token that may be used to cancel the operation.

System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<ITimeSeriesReference>>
A System.Threading.Tasks.Task<> of Result.

The Result will provide additional information about success or failure.

© 2026 Volue.Version v0.6.38017 November 2026