/// <summary> /// Enum types are equal by primary key /// </summary> public bool Equals(ActionItemState other) { if (other == null) { return(false); } return(other.ActionItemStateID == ActionItemStateID); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public ActionItem(ActionItemState actionItemState, Person assignedToPerson, DateTime assignedOnDate, DateTime dueByDate, Project project) : this() { // Mark this as a new object by setting primary key with special value this.ActionItemID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.ActionItemStateID = actionItemState.ActionItemStateID; this.AssignedToPersonID = assignedToPerson.PersonID; this.AssignedToPerson = assignedToPerson; assignedToPerson.ActionItemsWhereYouAreTheAssignedToPerson.Add(this); this.AssignedOnDate = assignedOnDate; this.DueByDate = dueByDate; this.ProjectID = project.ProjectID; this.Project = project; project.ActionItems.Add(this); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static ActionItem CreateNewBlank(ActionItemState actionItemState, Person assignedToPerson, Project project) { return(new ActionItem(actionItemState, assignedToPerson, default(DateTime), default(DateTime), project)); }