Table of Contents

Method StageAsync

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

StageAsync(IPersistenceSession, MailAccountId, StoredEmailId, IReadOnlyList<ExtractedCalendarEvent>, CancellationToken)

Stages what a reading found onto the calendar of each person the mailbox serves.

public Task<int> StageAsync(IPersistenceSession session, MailAccountId account, StoredEmailId sourceMessage, IReadOnlyList<ExtractedCalendarEvent> proposals, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The session the writes join.

account MailAccountId

The mailbox the message arrived in, whose assigned people are proposed to.

sourceMessage StoredEmailId

The message the events were read out of, which every proposal cites.

proposals IReadOnlyList<ExtractedCalendarEvent>

What the reading found, and empty where it found nothing.

cancellationToken CancellationToken

Cancels the staging.

Returns

Task<int>

How many rows were staged, across every calendar reached.

Remarks

Staged rather than committed, so that the proposals and the record saying this message has been read become durable together: a commit that carried one without the other would either propose from a message a later run reads again or lose the proposals of a message nothing will offer twice.

Exceptions

ArgumentNullException

Thrown when a required argument is null.