Table of Contents

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

session IPersistenceSession

The session the write joins.

owner UserId

The person whose calendar the event is written into.

calendarEvent CalendarEvent

The event to add.

cancellationToken CancellationToken

Cancels 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 owner names nobody.