Class IResourceReferenceExtensions
- Namespace
- Acuit.Pinpoint.ResourceManagement
- Assembly
- Acuit.Pinpoint.ResourceManagement.Abstractions.dll
Extensions for IResourceReference.
public static class IResourceReferenceExtensions
- Inheritance
-
IResourceReferenceExtensions
- Inherited Members
Methods
GetValueAsync<T>(IResourceReference, CancellationToken)
Gets the strongly-typed resource value.
public static Task<T> GetValueAsync<T>(this IResourceReference resourceReference, CancellationToken cancellationToken = default)
Parameters
resourceReference
IResourceReferenceThe resource reference.
cancellationToken
CancellationTokenA cancellation token that can be used to request canceling retrieving the resource.
Returns
- Task<T>
A task that represents the asynchronous operation. The value of its Result property contains the resource value.
Type Parameters
T
The resource value type.
Remarks
See the remarks for GetValueAsync(CancellationToken) for more information.
Exceptions
- ArgumentNullException
resourceReference
is null.- InvalidCastException
The resource value type is not compatible with
T
.- Exception
The resource could not be retrieved.