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
emailIdStoredEmailIdThe stored occurrence classified.
verdictSpamVerdictWhat was concluded.
decidedBySpamClassificationStageWhich stage reached the verdict.
assessmentSpamAssessmentThe score and threshold, or null when no number was produced.
corpusRevisionstringThe rule corpus the deciding stage ran under, or null when it has none.
profileSpamClassificationProfileThe settings the verdict was reached under, or the unspecified value for a record that names none.
signalsIReadOnlyList<SpamSignal>The facts the verdict rests on.
evaluatedAtDateTimeOffsetWhen 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
signalsis 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.