public SourceControlBMPSimple(SourceControlBMPAttribute sourceControlBMPAttribute) { SourceControlBMPID = null; SourceControlBMPAttributeCategoryID = sourceControlBMPAttribute.SourceControlBMPAttributeCategoryID; SourceControlBMPAttributeCategoryName = sourceControlBMPAttribute.SourceControlBMPAttributeCategory.SourceControlBMPAttributeCategoryName; SourceControlBMPAttributeID = sourceControlBMPAttribute.SourceControlBMPAttributeID; SourceControlBMPAttributeName = sourceControlBMPAttribute.SourceControlBMPAttributeName; IsPresent = null; SourceControlBMPNote = null; }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static SourceControlBMP CreateNewBlank(WaterQualityManagementPlan waterQualityManagementPlan, SourceControlBMPAttribute sourceControlBMPAttribute) { return(new SourceControlBMP(waterQualityManagementPlan, sourceControlBMPAttribute)); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public SourceControlBMP(WaterQualityManagementPlan waterQualityManagementPlan, SourceControlBMPAttribute sourceControlBMPAttribute) : this() { // Mark this as a new object by setting primary key with special value this.SourceControlBMPID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.WaterQualityManagementPlanID = waterQualityManagementPlan.WaterQualityManagementPlanID; this.WaterQualityManagementPlan = waterQualityManagementPlan; waterQualityManagementPlan.SourceControlBMPs.Add(this); this.SourceControlBMPAttributeID = sourceControlBMPAttribute.SourceControlBMPAttributeID; this.SourceControlBMPAttribute = sourceControlBMPAttribute; sourceControlBMPAttribute.SourceControlBMPs.Add(this); }
public static void DeleteSourceControlBMPAttribute(this IQueryable <SourceControlBMPAttribute> sourceControlBMPAttributes, SourceControlBMPAttribute sourceControlBMPAttributeToDelete) { DeleteSourceControlBMPAttribute(sourceControlBMPAttributes, new List <SourceControlBMPAttribute> { sourceControlBMPAttributeToDelete }); }