Method FindLatestAsync
- Namespace
- MailFathom.Application.Spam.Runs
- Assembly
- MailFathom.Application.dll
FindLatestAsync(MailAccountId, CancellationToken)
Reads the run one account has outstanding, or the last one it finished.
public Task<SpamClassificationRun?> FindLatestAsync(MailAccountId account, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account whose run is read, by its generated identifier.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<SpamClassificationRun>
The run, or null where the account has never been asked for one.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the use case was reached by anything but a caller granted AdminRead at a scope covering the account.
- OperationCanceledException
Thrown when the caller cancels.