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
idPersonalTaskIdWhat addresses the task.
userUserIdThe person whose list it is on.
titlestringThe line the list is drawn with.
dueOnDateOnly?The day it is due on, or null where nobody has said when.
announcementTaskAnnouncementWhat announces it and the offset its due day runs in, as the row states them.
originPersonalTaskOriginWhere the task came from.
sourceMessageStoredEmailId?The message it was read out of, or null where it names none.
isCompletedboolWhether 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
announcementis null.- ArgumentException
Thrown when
titleis blank, whenusernames nobody, whenidis the struct default, when one lead is stated twice, or when leads are stated against no due day.- ArgumentOutOfRangeException
Thrown when
originis not a declared origin, whentitleexceeds MaximumTitleLength, when more than MaximumCount leads are stated, or when the stated offset is not one a UTC offset can be.