Table of Contents

Method SaveAsync

Namespace
MailFathom.Application.Spam
Assembly
MailFathom.Application.dll

SaveAsync(IPersistenceSession, SpamClassification, CancellationToken)

Stages the classification of one occurrence, replacing whatever was recorded for it.

Task SaveAsync(IPersistenceSession session, SpamClassification classification, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The explicit persistence session this write participates in.

classification SpamClassification

What to record.

cancellationToken CancellationToken

Cancels the lookup before anything is staged.

Returns

Task

A task that completes once the write is staged in the caller's session.

Remarks

Staged rather than committed, so the record and the signals it rests on reach the database as one unit. Replacing an existing record replaces its signals with it: a classification is what is believed now, and keeping the signals of a superseded verdict beside the new ones would leave a record nobody could read.

Exceptions

ArgumentNullException

Thrown when classification is null.