Table of Contents

Method ReplaceAsync

Namespace
MailFathom.Application.Calendar
Assembly
MailFathom.Application.dll

ReplaceAsync(IPersistenceSession, UserId, CalendarEvent, CancellationToken)

Stages the held event being replaced by the one supplied.

Task<bool> ReplaceAsync(IPersistenceSession session, UserId owner, CalendarEvent calendarEvent, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The session the write joins.

owner UserId

The person whose calendar holds the event being replaced.

calendarEvent CalendarEvent

The event as it is to stand, identified by its own identity.

cancellationToken CancellationToken

Cancels the staging.

Returns

Task<bool>

true when that calendar held the event and the replacement was staged; false when it holds none.

Remarks

This is how an amendment and an acceptance are both written, since both answer with the event as it is to stand. An event deleted while either was in flight is a write affecting no row, which the row's concurrency token turns into a conflict — so the retry reads a calendar that holds nothing and answers so rather than putting the event back.

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.