/// <summary> /// Enum types are equal by primary key /// </summary> public bool Equals(ProjectCustomAttributeDataType other) { if (other == null) { return(false); } return(other.ProjectCustomAttributeDataTypeID == ProjectCustomAttributeDataTypeID); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public ProjectCustomAttributeType(string projectCustomAttributeTypeName, ProjectCustomAttributeDataType projectCustomAttributeDataType, bool isRequired, bool isViewableOnFactSheet, ProjectCustomAttributeGroup projectCustomAttributeGroup) : this() { // Mark this as a new object by setting primary key with special value this.ProjectCustomAttributeTypeID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.ProjectCustomAttributeTypeName = projectCustomAttributeTypeName; this.ProjectCustomAttributeDataTypeID = projectCustomAttributeDataType.ProjectCustomAttributeDataTypeID; this.IsRequired = isRequired; this.IsViewableOnFactSheet = isViewableOnFactSheet; this.ProjectCustomAttributeGroupID = projectCustomAttributeGroup.ProjectCustomAttributeGroupID; this.ProjectCustomAttributeGroup = projectCustomAttributeGroup; projectCustomAttributeGroup.ProjectCustomAttributeTypes.Add(this); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static ProjectCustomAttributeType CreateNewBlank(ProjectCustomAttributeDataType projectCustomAttributeDataType, ProjectCustomAttributeGroup projectCustomAttributeGroup) { return(new ProjectCustomAttributeType(default(string), projectCustomAttributeDataType, default(bool), default(bool), projectCustomAttributeGroup)); }