/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (NeptuneHomePageImages.Any()) { dependentObjects.Add(typeof(NeptuneHomePageImage).Name); } if (NeptunePageImages.Any()) { dependentObjects.Add(typeof(NeptunePageImage).Name); } if (OnlandVisualTrashAssessmentObservationPhotos.Any()) { dependentObjects.Add(typeof(OnlandVisualTrashAssessmentObservationPhoto).Name); } if (OnlandVisualTrashAssessmentObservationPhotoStagings.Any()) { dependentObjects.Add(typeof(OnlandVisualTrashAssessmentObservationPhotoStaging).Name); } if (OrganizationsWhereYouAreTheLogoFileResource.Any()) { dependentObjects.Add(typeof(Organization).Name); } if (TreatmentBMPAssessmentPhotos.Any()) { dependentObjects.Add(typeof(TreatmentBMPAssessmentPhoto).Name); } if (TreatmentBMPDocuments.Any()) { dependentObjects.Add(typeof(TreatmentBMPDocument).Name); } if (TreatmentBMPImages.Any()) { dependentObjects.Add(typeof(TreatmentBMPImage).Name); } if (WaterQualityManagementPlanDocuments.Any()) { dependentObjects.Add(typeof(WaterQualityManagementPlanDocument).Name); } if (WaterQualityManagementPlanPhotos.Any()) { dependentObjects.Add(typeof(WaterQualityManagementPlanPhoto).Name); } if (WaterQualityManagementPlanVerifies.Any()) { dependentObjects.Add(typeof(WaterQualityManagementPlanVerify).Name); } return(dependentObjects.Distinct().ToList()); }
/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in NeptuneHomePageImages.ToList()) { x.DeleteFull(dbContext); } foreach (var x in NeptunePageImages.ToList()) { x.DeleteFull(dbContext); } foreach (var x in OnlandVisualTrashAssessmentObservationPhotos.ToList()) { x.DeleteFull(dbContext); } foreach (var x in OnlandVisualTrashAssessmentObservationPhotoStagings.ToList()) { x.DeleteFull(dbContext); } foreach (var x in OrganizationsWhereYouAreTheLogoFileResource.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPAssessmentPhotos.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPDocuments.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPImages.ToList()) { x.DeleteFull(dbContext); } foreach (var x in WaterQualityManagementPlanDocuments.ToList()) { x.DeleteFull(dbContext); } foreach (var x in WaterQualityManagementPlanPhotos.ToList()) { x.DeleteFull(dbContext); } foreach (var x in WaterQualityManagementPlanVerifies.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in CustomAttributes.ToList()) { x.DeleteFull(dbContext); } foreach (var x in Delineations.ToList()) { x.DeleteFull(dbContext); } foreach (var x in FieldVisits.ToList()) { x.DeleteFull(dbContext); } foreach (var x in FundingEvents.ToList()) { x.DeleteFull(dbContext); } foreach (var x in MaintenanceRecords.ToList()) { x.DeleteFull(dbContext); } foreach (var x in RegionalSubbasinRevisionRequests.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPsWhereYouAreTheUpstreamBMP.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPAssessments.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPBenchmarkAndThresholds.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPDocuments.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPImages.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPModelingAttributes.ToList()) { x.DeleteFull(dbContext); } foreach (var x in TreatmentBMPModelingAttributesWhereYouAreTheUpstreamTreatmentBMP.ToList()) { x.DeleteFull(dbContext); } foreach (var x in WaterQualityManagementPlanVerifyTreatmentBMPs.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (CustomAttributes.Any()) { dependentObjects.Add(typeof(CustomAttribute).Name); } if ((Delineation != null)) { dependentObjects.Add(typeof(Delineation).Name); } if (FieldVisits.Any()) { dependentObjects.Add(typeof(FieldVisit).Name); } if (FundingEvents.Any()) { dependentObjects.Add(typeof(FundingEvent).Name); } if (MaintenanceRecords.Any()) { dependentObjects.Add(typeof(MaintenanceRecord).Name); } if (RegionalSubbasinRevisionRequests.Any()) { dependentObjects.Add(typeof(RegionalSubbasinRevisionRequest).Name); } if (TreatmentBMPsWhereYouAreTheUpstreamBMP.Any()) { dependentObjects.Add(typeof(TreatmentBMP).Name); } if (TreatmentBMPAssessments.Any()) { dependentObjects.Add(typeof(TreatmentBMPAssessment).Name); } if (TreatmentBMPBenchmarkAndThresholds.Any()) { dependentObjects.Add(typeof(TreatmentBMPBenchmarkAndThreshold).Name); } if (TreatmentBMPDocuments.Any()) { dependentObjects.Add(typeof(TreatmentBMPDocument).Name); } if (TreatmentBMPImages.Any()) { dependentObjects.Add(typeof(TreatmentBMPImage).Name); } if ((TreatmentBMPModelingAttribute != null)) { dependentObjects.Add(typeof(TreatmentBMPModelingAttribute).Name); } if (TreatmentBMPModelingAttributesWhereYouAreTheUpstreamTreatmentBMP.Any()) { dependentObjects.Add(typeof(TreatmentBMPModelingAttribute).Name); } if (WaterQualityManagementPlanVerifyTreatmentBMPs.Any()) { dependentObjects.Add(typeof(WaterQualityManagementPlanVerifyTreatmentBMP).Name); } return(dependentObjects.Distinct().ToList()); }
/// <summary> /// Does this object have any dependent objects? (If it does have dependent objects, these would need to be deleted before this object could be deleted.) /// </summary> /// <returns></returns> public bool HasDependentObjects() { return(CustomAttributes.Any() || (Delineation != null) || FieldVisits.Any() || FundingEvents.Any() || MaintenanceRecords.Any() || RegionalSubbasinRevisionRequests.Any() || TreatmentBMPsWhereYouAreTheUpstreamBMP.Any() || TreatmentBMPAssessments.Any() || TreatmentBMPBenchmarkAndThresholds.Any() || TreatmentBMPDocuments.Any() || TreatmentBMPImages.Any() || (TreatmentBMPModelingAttribute != null) || TreatmentBMPModelingAttributesWhereYouAreTheUpstreamTreatmentBMP.Any() || WaterQualityManagementPlanVerifyTreatmentBMPs.Any()); }
/// <summary> /// Does this object have any dependent objects? (If it does have dependent objects, these would need to be deleted before this object could be deleted.) /// </summary> /// <returns></returns> public bool HasDependentObjects() { return(NeptuneHomePageImages.Any() || NeptunePageImages.Any() || OnlandVisualTrashAssessmentObservationPhotos.Any() || OnlandVisualTrashAssessmentObservationPhotoStagings.Any() || OrganizationsWhereYouAreTheLogoFileResource.Any() || TreatmentBMPAssessmentPhotos.Any() || TreatmentBMPDocuments.Any() || TreatmentBMPImages.Any() || WaterQualityManagementPlanDocuments.Any() || WaterQualityManagementPlanPhotos.Any() || WaterQualityManagementPlanVerifies.Any()); }