Table of Contents

Method Create

Namespace
MailFathom.Domain.Spam
Assembly
MailFathom.Domain.dll

Create(StoredEmailId, SpamVerdict, SpamClassificationStage, SpamAssessment?, string?, SpamClassificationProfile, IReadOnlyList<SpamSignal>, DateTimeOffset)

Records what a stage concluded about one occurrence.

public static SpamClassification Create(StoredEmailId emailId, SpamVerdict verdict, SpamClassificationStage decidedBy, SpamAssessment? assessment, string? corpusRevision, SpamClassificationProfile profile, IReadOnlyList<SpamSignal> signals, DateTimeOffset evaluatedAt)

Parameters

emailId StoredEmailId

The stored occurrence classified.

verdict SpamVerdict

What was concluded.

decidedBy SpamClassificationStage

Which stage reached the verdict.

assessment SpamAssessment

The score and threshold, or null when no number was produced.

corpusRevision string

The rule corpus the deciding stage ran under, or null when it has none.

profile SpamClassificationProfile

The settings the verdict was reached under, or the unspecified value for a record that names none.

signals IReadOnlyList<SpamSignal>

The facts the verdict rests on.

evaluatedAt DateTimeOffset

When the classification was evaluated.

Returns

SpamClassification

The classification, holding no more than MaximumSignals signals.

Remarks

An unspecified profile is accepted rather than refused, because a record written before the profile was part of one has to be readable: refusing it here would make a row this system itself wrote unreadable to the code that replaced it.

Exceptions

ArgumentNullException

Thrown when signals is null.

ArgumentException

Thrown when the corpus revision is blank, over-long, or carries a control character.

ArgumentOutOfRangeException

Thrown when the verdict or the stage is not a defined member.