/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public Agreement(AgreementType agreementType, string agreementTitle, Organization organization) : this() { // Mark this as a new object by setting primary key with special value this.AgreementID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.AgreementTypeID = agreementType.AgreementTypeID; this.AgreementType = agreementType; agreementType.Agreements.Add(this); this.AgreementTitle = agreementTitle; this.OrganizationID = organization.OrganizationID; this.Organization = organization; organization.Agreements.Add(this); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static Agreement CreateNewBlank(AgreementType agreementType, Organization organization) { return(new Agreement(agreementType, default(string), organization)); }
public static void DeleteAgreementType(this IQueryable <AgreementType> agreementTypes, AgreementType agreementTypeToDelete) { DeleteAgreementType(agreementTypes, new List <AgreementType> { agreementTypeToDelete }); }