Interface IInfoProvider<TInfo>
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Declares members for retrieval and manipulation of info objects. The system registers corresponding TInfo provider implementation
under this interface into the IoC container as part of the RegisterObjectType(string, ObjectTypeInfo, Type, bool, bool) method.
Provider types declaring their own interface using the ProviderInterfaceAttribute class are registered under that interface as well.
To retrieve an instance of the provider use Resolve<TService>() or constructor dependency on the interface.
public interface IInfoProvider<TInfo> where TInfo : AbstractInfoBase<TInfo>, new()
Type Parameters
TInfoType of info object managed by the provider.
- Extension Methods
Remarks
When declaring a custom provider interface, this interface and IInfoByIdProvider<TInfo>, IInfoByGuidProvider<TInfo> or IInfoByNameProvider<TInfo> can be used along with other custom members.
Methods
Delete(TInfo)
Deletes the info object from the underlying data store.
void Delete(TInfo info)
Parameters
infoTInfoInfo object to be deleted.
Exceptions
- ArgumentNullException
Thrown when
infois null.
DeleteAsync(TInfo, CancellationToken?)
Asynchronously deletes the info object from the underlying data store.
Task DeleteAsync(TInfo info, CancellationToken? cancellationToken = null)
Parameters
infoTInfoInfo object to be deleted.
cancellationTokenCancellationToken?The cancellation instruction.
Returns
- Task
Remarks
For compatibility reasons, the interface provides default implementation which invokes the synchronous Delete(TInfo).
Exceptions
- ArgumentNullException
Thrown when
infois null.
Get()
Gets the object query for TInfo retrieval.
ObjectQuery<TInfo> Get()
Returns
- ObjectQuery<TInfo>
Returns ObjectQuery<TObject> for
TInforetrieval.
Set(TInfo)
Inserts or updates the info object in the underlying data store.
void Set(TInfo info)
Parameters
infoTInfoInfo object to be inserted or updated.
Exceptions
- ArgumentNullException
Thrown when
infois null.
SetAsync(TInfo, CancellationToken?)
Asynchronously inserts or updates the info object in the underlying data store.
Task SetAsync(TInfo info, CancellationToken? cancellationToken = null)
Parameters
infoTInfoInfo object to be inserted or updated.
cancellationTokenCancellationToken?The cancellation instruction.
Returns
- Task
Remarks
For compatibility reasons, the interface provides default implementation which invokes the synchronous Set(TInfo).
Exceptions
- ArgumentNullException
Thrown when
infois null.