IAttributeStore<TIdentifier> Interface
Used to find, load, save or delete IAttributes. Should only be instantiated by an IAttributeStoreFactory.
public interface IAttributeStore<TIdentifier> : HAKOM.TSM.Net.Api.Attributes.Persistence.IAttributeStore, HAKOM.Persistence.Core.Net.Api.Storage.IStore<HAKOM.Persistence.Core.Net.Api.Storage.IStorageProvider> where TIdentifier : System.IEquatable<TIdentifier>Type parameters
Section titled “Type parameters”TIdentifier
The type of unique identifier used to refer to IAttribute objects.
Implements IAttributeStore, HAKOM.Persistence.Core.Net.Api.Storage.IStore<IStorageProvider>
Properties
Section titled “Properties”IAttributeStore<TIdentifier>.References Property
Section titled “IAttributeStore<TIdentifier>.References Property”Gets a factory used to create IAttributeReference<TIdentifier> objects.
HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReferenceFactory<TIdentifier> References { get; }Property Value
Section titled “Property Value”HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReferenceFactory<TIdentifier>
Methods
Section titled “Methods”IAttributeStore<TIdentifier>.Delete(IAttributeReference<TIdentifier>, bool, CancellationToken) Method
Section titled “IAttributeStore<TIdentifier>.Delete(IAttributeReference<TIdentifier>, bool, CancellationToken) Method”Deletes the IAttribute referred to by the given attributeReference from the repository.
If force is true, all assignments with this attribute will be deleted (cascade delete).
If force is false and assignments exist, an exception is thrown listing the assignments.
System.Threading.Tasks.Task Delete(HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference<TIdentifier> attributeReference, bool force=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”attributeReference HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference<TIdentifier>
An IAttributeReference<TIdentifier> to the IAttribute which will be deleted.
force System.Boolean
If true, deletes all assignments with this attribute. If false, throws if assignments exist. Default is false.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task
An awaitable System.Threading.Tasks.Task indicating that the process is finished.
IAttributeStore<TIdentifier>.Load(TIdentifier, CancellationToken) Method
Section titled “IAttributeStore<TIdentifier>.Load(TIdentifier, CancellationToken) Method”Loads the IAttributeReference with the given identifier.
System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference> Load(TIdentifier identifier, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”identifier TIdentifier
The unique identifier of the attribute in the repository.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<IAttributeReference>
A System.Threading.Tasks.Task<> containing an IAttributeReference to
the desired IAttribute.
IAttributeStore<TIdentifier>.SaveOrUpdate(TIdentifier, IAttribute, CancellationToken) Method
Section titled “IAttributeStore<TIdentifier>.SaveOrUpdate(TIdentifier, IAttribute, CancellationToken) Method”Persists the given IAttribute to the repository or updates it, if it already exists.
System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference> SaveOrUpdate(TIdentifier identifier, HAKOM.TSM.Net.Api.Attributes.IAttribute attribute, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”identifier TIdentifier
The unique identifier of the attribute in the repository.
attribute IAttribute
The IAttribute which will be persisted.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<IAttributeReference>
A System.Threading.Tasks.Task<> containing a reference to the persisted attribute.
IAttributeStore<TIdentifier>.TryDelete(IAttributeReference<TIdentifier>, bool, CancellationToken) Method
Section titled “IAttributeStore<TIdentifier>.TryDelete(IAttributeReference<TIdentifier>, bool, CancellationToken) Method”Attempts to delete the IAttribute referred to by the given attributeReference from the repository.
If force is true, all assignments with this attribute will be deleted (cascade delete).
If force is false and assignments exist, the result will contain an error listing the assignments.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result> TryDelete(HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference<TIdentifier> attributeReference, bool force=false, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”attributeReference HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference<TIdentifier>
An IAttributeReference<TIdentifier> to the IAttribute which will be deleted.
force System.Boolean
If true, deletes all assignments with this attribute. If false, fails if assignments exist. Default is false.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<Result>
An awaitable System.Threading.Tasks.Task<> indicating that the process is finished.
Remarks
Section titled “Remarks”The Result contains an error, when the operation fails.
IAttributeStore<TIdentifier>.TryLoad(TIdentifier, CancellationToken) Method
Section titled “IAttributeStore<TIdentifier>.TryLoad(TIdentifier, CancellationToken) Method”Attempts to load the IAttributeReference with the given identifier.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference>> TryLoad(TIdentifier identifier, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”identifier TIdentifier
The unique identifier of the attribute in the repository.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<IAttributeReference>>
A System.Threading.Tasks.Task<> of Result<TValue> containing a reference to the desired attribute.
IAttributeStore<TIdentifier>.TrySaveOrUpdate(TIdentifier, IAttribute, CancellationToken) Method
Section titled “IAttributeStore<TIdentifier>.TrySaveOrUpdate(TIdentifier, IAttribute, CancellationToken) Method”Attempts to persist the given IAttribute to the repository or updates it, if it already exists.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Attributes.Persistence.References.IAttributeReference>> TrySaveOrUpdate(TIdentifier identifier, HAKOM.TSM.Net.Api.Attributes.IAttribute attribute, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”identifier TIdentifier
The unique identifier of the attribute in the repository.
attribute IAttribute
The IAttribute which will be persisted.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<IAttributeReference>>
A System.Threading.Tasks.Task<> of Result<TValue> containing a reference to the persisted attribute.