Method GetSectionByIdentifierAsync
GetSectionByIdentifierAsync(string, CancellationToken)
Asynchronously retrieves a Section object from this instance based on the specified identifier.
public Task<Section> GetSectionByIdentifierAsync(string sectionIdentifier, CancellationToken cancellationToken = default)
Parameters
sectionIdentifier
stringThe unique identifier for the section to be retrieved. This identifier is used to locate the corresponding Section within the collection.
cancellationToken
CancellationTokenA token to monitor for cancellation requests. The default value is None.
Returns
- Task<Section>
A Task<TResult> representing the asynchronous operation. The task result contains the Section that matches the given identifier.
Exceptions
- KeyNotFoundException
Thrown when no section with the specified identifier can be found in the collection.