Method AddAsync
- Namespace
- MailFathom.Application.Calendar
- Assembly
- MailFathom.Application.dll
AddAsync(IPersistenceSession, UserId, CalendarEvent, CancellationToken)
Stages an event the calendar does not yet hold.
Task AddAsync(IPersistenceSession session, UserId owner, CalendarEvent calendarEvent, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
ownerUserIdThe person whose calendar the event is written into.
calendarEventCalendarEventThe event to add.
cancellationTokenCancellationTokenCancels the staging.
Returns
- Task
A task that completes once the insert is staged; nothing is committed here.
Remarks
That one calendar holds an imported identifier once is a unique index rather than a check before the insert: two imports of one file read nothing twice, so only the constraint closes that window, and the second writer is refused by the database instead of doubling the calendar.
Exceptions
- ArgumentNullException
Thrown when a required argument is null.
- ArgumentException
Thrown when the session cannot supply this store's persistence context, or when
ownernames nobody.