public void UpdateFrom(TodoBag t) { if (Status != t.Status) { MarkAs(t.Status, DateTime.Today); } if (Due != t.Due) { Due = t.Due.HasValue ? t.Due : Due; } if (Description != t.Description) { Description = !string.IsNullOrWhiteSpace(t.Description) ? t.Description : Description; } }
public static Todo CreateFrom(TodoBag t) { return(new Todo(t.Description, t.Due, t.Status)); }