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
sessionIPersistenceSessionThe session the write joins.
ownerUserIdThe person whose calendar holds the event being replaced.
calendarEventCalendarEventThe event as it is to stand, identified by its own identity.
cancellationTokenCancellationTokenCancels 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
ownernames nobody.