Method ReadImportedUidsAsync
- Namespace
- MailFathom.Application.Calendar
- Assembly
- MailFathom.Application.dll
ReadImportedUidsAsync(UserId, IReadOnlyCollection<ImportedCalendarEventUid>, CancellationToken)
Reports which of the stated imported identifiers somebody's calendar already holds.
Task<IReadOnlySet<ImportedCalendarEventUid>> ReadImportedUidsAsync(UserId owner, IReadOnlyCollection<ImportedCalendarEventUid> candidates, CancellationToken cancellationToken)
Parameters
ownerUserIdThe person whose calendar is read.
candidatesIReadOnlyCollection<ImportedCalendarEventUid>The identifiers an offered file names, which bounds the read.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlySet<ImportedCalendarEventUid>>
The subset of
candidatesthat calendar already holds, which is empty where it holds none.
Remarks
Asked about the identifiers of one file rather than about the calendar, so the read is bounded by what somebody chose to import instead of growing with the events they have imported before. It is what turns a second import of one file into a count of entries skipped rather than a doubled calendar, and it is not what makes that safe — the unique index on ICalendarEventStore's own insert is, because two imports running at once both read nothing here.
Exceptions
- ArgumentNullException
Thrown when
candidatesis null.- ArgumentException
Thrown when
ownernames nobody.