Table of Contents

Method Restore

Namespace
MailFathom.Domain.Tasks
Assembly
MailFathom.Domain.dll

Restore(PersonalTaskId, UserId, string, DateOnly?, TaskAnnouncement, PersonalTaskOrigin, StoredEmailId?, bool)

Restores a task this deployment already kept, with the origin and completion it was stored under.

public static PersonalTask Restore(PersonalTaskId id, UserId user, string title, DateOnly? dueOn, TaskAnnouncement announcement, PersonalTaskOrigin origin, StoredEmailId? sourceMessage, bool isCompleted)

Parameters

id PersonalTaskId

What addresses the task.

user UserId

The person whose list it is on.

title string

The line the list is drawn with.

dueOn DateOnly?

The day it is due on, or null where nobody has said when.

announcement TaskAnnouncement

What announces it and the offset its due day runs in, as the row states them.

origin PersonalTaskOrigin

Where the task came from.

sourceMessage StoredEmailId?

The message it was read out of, or null where it names none.

isCompleted bool

Whether the person has done it.

Returns

PersonalTask

The task as it stands.

Remarks

It validates exactly what Compose(PersonalTaskId, UserId, string, DateOnly?, TaskAnnouncement, PersonalTaskOrigin, StoredEmailId?) validates rather than trusting the store, because a row read back is input from outside this process however it got there. The two things it takes that composing does not are the store's to say and never a producer's: whether the task has been completed, and whether a proposal has since been accepted.

Exceptions

ArgumentNullException

Thrown when announcement is null.

ArgumentException

Thrown when title is blank, when user names nobody, when id is the struct default, when one lead is stated twice, or when leads are stated against no due day.

ArgumentOutOfRangeException

Thrown when origin is not a declared origin, when title exceeds MaximumTitleLength, when more than MaximumCount leads are stated, or when the stated offset is not one a UTC offset can be.