Interface IInfoByGuidProvider<TInfo>
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Declares a member for retrieval of info objects by their GUID.
Use this interface when composing a custom provider interface. A custom provider interface can be associated with the provider using the ProviderInterfaceAttribute.
The system registers corresponding TInfo provider implementation
under the custom interface into the IoC container as part of the RegisterObjectType(string, ObjectTypeInfo, Type, bool, bool) method.
Unlike with IInfoProvider<TInfo> the system does not register the provider implementation under this interface (i.e. this interface is designed to be a part of other interfaces).
public interface IInfoByGuidProvider<TInfo> where TInfo : AbstractInfoBase<TInfo>, new()
Type Parameters
TInfoType of info object managed by the provider.
- Extension Methods
Methods
Get(Guid)
Gets an instance of info object based on its GUID.
TInfo Get(Guid guid)
Parameters
guidGuidGUID of the info object to look for.
Returns
- TInfo
Returns an instance of
TInfocorresponding toguidor null.
Exceptions
- NotSupportedException
Thrown when
TInfodoes not have the GUID column.
GetAsync(Guid, CancellationToken?)
Asynchronously gets an instance of info object based on its GUID.
Task<TInfo> GetAsync(Guid guid, CancellationToken? cancellationToken = null)
Parameters
guidGuidGUID of the info object to look for.
cancellationTokenCancellationToken?The cancellation instruction.
Returns
- Task<TInfo>
Returns a task returning either an instance of
TInfocorresponding toguidor null.
Exceptions
- NotSupportedException
Thrown when
TInfodoes not have the GUID column.