Class InfoProviderExtensions
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Contains extension methods for IInfoProvider<TInfo>.
public static class InfoProviderExtensions
- Inheritance
-
objectInfoProviderExtensions
Methods
GetAsync<TInfo>(IInfoProvider<TInfo>, Guid, CancellationToken?)
Asynchronously gets an instance of info object based on its GUID.
public static Task<TInfo> GetAsync<TInfo>(this IInfoProvider<TInfo> infoProvider, Guid guid, CancellationToken? cancellationToken = null) where TInfo : AbstractInfoBase<TInfo>, IInfoWithGuid, new()
Parameters
infoProviderIInfoProvider<TInfo>TInfoprovider to use to retrieve the info object.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.
Type Parameters
TInfoType of info object managed by the provider.
Exceptions
- ArgumentNullException
Thrown when
infoProvideris null.
GetAsync<TInfo>(IInfoProvider<TInfo>, int, CancellationToken?)
Asynchronously gets an instance of info object based on its ID.
public static Task<TInfo> GetAsync<TInfo>(this IInfoProvider<TInfo> infoProvider, int id, CancellationToken? cancellationToken = null) where TInfo : AbstractInfoBase<TInfo>, IInfoWithId, new()
Parameters
infoProviderIInfoProvider<TInfo>TInfoprovider to use to retrieve the info object.idintID of the info object to look for.
cancellationTokenCancellationToken?The cancellation instruction.
Returns
- Task<TInfo>
Returns a task returning either an instance of
TInfocorresponding toidor null.
Type Parameters
TInfoType of info object managed by the provider.
Exceptions
- ArgumentNullException
Thrown when
infoProvideris null.
GetAsync<TInfo>(IInfoProvider<TInfo>, string, CancellationToken?)
Asynchronously gets an instance of info object based on its code name.
public static Task<TInfo> GetAsync<TInfo>(this IInfoProvider<TInfo> infoProvider, string name, CancellationToken? cancellationToken = null) where TInfo : AbstractInfoBase<TInfo>, IInfoWithName, new()
Parameters
infoProviderIInfoProvider<TInfo>TInfoprovider to use to retrieve the info object.namestringCode name of the info object to look for.
cancellationTokenCancellationToken?The cancellation instruction.
Returns
- Task<TInfo>
Returns a task returning either an instance of
TInfocorresponding tonameor null.
Type Parameters
TInfoType of info object managed by the provider.
Exceptions
- ArgumentNullException
Thrown when
infoProvideris null.
Get<TInfo>(IInfoProvider<TInfo>, Guid)
Gets an instance of info object based on its GUID.
public static TInfo Get<TInfo>(this IInfoProvider<TInfo> infoProvider, Guid guid) where TInfo : AbstractInfoBase<TInfo>, IInfoWithGuid, new()
Parameters
infoProviderIInfoProvider<TInfo>TInfoprovider to use to retrieve the info object.guidGuidGUID of the info object to look for.
Returns
- TInfo
Returns an instance of
TInfocorresponding toguidor null.
Type Parameters
TInfoType of info object managed by the provider.
Exceptions
- ArgumentNullException
Thrown when
infoProvideris null.
Get<TInfo>(IInfoProvider<TInfo>, int)
Gets an instance of info object based on its ID.
public static TInfo Get<TInfo>(this IInfoProvider<TInfo> infoProvider, int id) where TInfo : AbstractInfoBase<TInfo>, IInfoWithId, new()
Parameters
infoProviderIInfoProvider<TInfo>TInfoprovider to use to retrieve the info object.idintID of the info object to look for.
Returns
- TInfo
Returns an instance of
TInfocorresponding toidor null.
Type Parameters
TInfoType of info object managed by the provider.
Exceptions
- ArgumentNullException
Thrown when
infoProvideris null.
Get<TInfo>(IInfoProvider<TInfo>, string)
Gets an instance of info object based on its code name.
public static TInfo Get<TInfo>(this IInfoProvider<TInfo> infoProvider, string name) where TInfo : AbstractInfoBase<TInfo>, IInfoWithName, new()
Parameters
infoProviderIInfoProvider<TInfo>TInfoprovider to use to retrieve the info object.namestringCode name of the info object to look for.
Returns
- TInfo
Returns an instance of
TInfocorresponding tonameor null.
Type Parameters
TInfoType of info object managed by the provider.
Exceptions
- ArgumentNullException
Thrown when
infoProvideris null.