/// <summary> /// Enum types are equal by primary key /// </summary> public bool Equals(AgreementPersonRole other) { if (other == null) { return(false); } return(other.AgreementPersonRoleID == AgreementPersonRoleID); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public AgreementPerson(Agreement agreement, Person person, AgreementPersonRole agreementPersonRole) : this() { // Mark this as a new object by setting primary key with special value this.AgreementPersonID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.AgreementID = agreement.AgreementID; this.Agreement = agreement; agreement.AgreementPeople.Add(this); this.PersonID = person.PersonID; this.Person = person; person.AgreementPeople.Add(this); this.AgreementPersonRoleID = agreementPersonRole.AgreementPersonRoleID; }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static AgreementPerson CreateNewBlank(Agreement agreement, Person person, AgreementPersonRole agreementPersonRole) { return(new AgreementPerson(agreement, person, agreementPersonRole)); }