/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in PerformanceMeasureActualUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectCustomAttributeUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectDocumentUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectExemptReportingYearUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectExternalLinkUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectFundingSourceUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectGrantAllocationExpenditureUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectGrantAllocationRequestUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectImageUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectLocationStagingUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectLocationUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectNoteUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectOrganizationUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectPersonUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectPriorityLandscapeUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectRegionUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectUpdateHistories.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (PerformanceMeasureActualUpdates.Any()) { dependentObjects.Add(typeof(PerformanceMeasureActualUpdate).Name); } if (ProjectCustomAttributeUpdates.Any()) { dependentObjects.Add(typeof(ProjectCustomAttributeUpdate).Name); } if (ProjectDocumentUpdates.Any()) { dependentObjects.Add(typeof(ProjectDocumentUpdate).Name); } if (ProjectExemptReportingYearUpdates.Any()) { dependentObjects.Add(typeof(ProjectExemptReportingYearUpdate).Name); } if (ProjectExternalLinkUpdates.Any()) { dependentObjects.Add(typeof(ProjectExternalLinkUpdate).Name); } if (ProjectFundingSourceUpdates.Any()) { dependentObjects.Add(typeof(ProjectFundingSourceUpdate).Name); } if (ProjectGrantAllocationExpenditureUpdates.Any()) { dependentObjects.Add(typeof(ProjectGrantAllocationExpenditureUpdate).Name); } if (ProjectGrantAllocationRequestUpdates.Any()) { dependentObjects.Add(typeof(ProjectGrantAllocationRequestUpdate).Name); } if (ProjectImageUpdates.Any()) { dependentObjects.Add(typeof(ProjectImageUpdate).Name); } if (ProjectLocationStagingUpdates.Any()) { dependentObjects.Add(typeof(ProjectLocationStagingUpdate).Name); } if (ProjectLocationUpdates.Any()) { dependentObjects.Add(typeof(ProjectLocationUpdate).Name); } if (ProjectNoteUpdates.Any()) { dependentObjects.Add(typeof(ProjectNoteUpdate).Name); } if (ProjectOrganizationUpdates.Any()) { dependentObjects.Add(typeof(ProjectOrganizationUpdate).Name); } if (ProjectPersonUpdates.Any()) { dependentObjects.Add(typeof(ProjectPersonUpdate).Name); } if (ProjectPriorityLandscapeUpdates.Any()) { dependentObjects.Add(typeof(ProjectPriorityLandscapeUpdate).Name); } if (ProjectRegionUpdates.Any()) { dependentObjects.Add(typeof(ProjectRegionUpdate).Name); } if ((ProjectUpdate != null)) { dependentObjects.Add(typeof(ProjectUpdate).Name); } if (ProjectUpdateHistories.Any()) { dependentObjects.Add(typeof(ProjectUpdateHistory).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(PerformanceMeasureActualUpdates.Any() || ProjectCustomAttributeUpdates.Any() || ProjectDocumentUpdates.Any() || ProjectExemptReportingYearUpdates.Any() || ProjectExternalLinkUpdates.Any() || ProjectFundingSourceUpdates.Any() || ProjectGrantAllocationExpenditureUpdates.Any() || ProjectGrantAllocationRequestUpdates.Any() || ProjectImageUpdates.Any() || ProjectLocationStagingUpdates.Any() || ProjectLocationUpdates.Any() || ProjectNoteUpdates.Any() || ProjectOrganizationUpdates.Any() || ProjectPersonUpdates.Any() || ProjectPriorityLandscapeUpdates.Any() || ProjectRegionUpdates.Any() || (ProjectUpdate != null) || ProjectUpdateHistories.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(AgreementGrantAllocations.Any() || GrantAllocationAwards.Any() || GrantAllocationBudgetLineItems.Any() || GrantAllocationChangeLogs.Any() || GrantAllocationExpenditures.Any() || GrantAllocationFileResources.Any() || GrantAllocationNotes.Any() || GrantAllocationNoteInternals.Any() || GrantAllocationProgramIndexProjectCodes.Any() || GrantAllocationProgramManagers.Any() || InvoiceLineItems.Any() || ProjectGrantAllocationExpenditures.Any() || ProjectGrantAllocationExpenditureUpdates.Any() || ProjectGrantAllocationRequests.Any() || ProjectGrantAllocationRequestUpdates.Any()); }
/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in AgreementGrantAllocations.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationAwards.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationBudgetLineItems.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationChangeLogs.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationExpenditures.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationFileResources.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationNotes.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationNoteInternals.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationProgramIndexProjectCodes.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationProgramManagers.ToList()) { x.DeleteFull(dbContext); } foreach (var x in InvoiceLineItems.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectGrantAllocationExpenditures.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectGrantAllocationExpenditureUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectGrantAllocationRequests.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectGrantAllocationRequestUpdates.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (AgreementGrantAllocations.Any()) { dependentObjects.Add(typeof(AgreementGrantAllocation).Name); } if (GrantAllocationAwards.Any()) { dependentObjects.Add(typeof(GrantAllocationAward).Name); } if (GrantAllocationBudgetLineItems.Any()) { dependentObjects.Add(typeof(GrantAllocationBudgetLineItem).Name); } if (GrantAllocationChangeLogs.Any()) { dependentObjects.Add(typeof(GrantAllocationChangeLog).Name); } if (GrantAllocationExpenditures.Any()) { dependentObjects.Add(typeof(GrantAllocationExpenditure).Name); } if (GrantAllocationFileResources.Any()) { dependentObjects.Add(typeof(GrantAllocationFileResource).Name); } if (GrantAllocationNotes.Any()) { dependentObjects.Add(typeof(GrantAllocationNote).Name); } if (GrantAllocationNoteInternals.Any()) { dependentObjects.Add(typeof(GrantAllocationNoteInternal).Name); } if (GrantAllocationProgramIndexProjectCodes.Any()) { dependentObjects.Add(typeof(GrantAllocationProgramIndexProjectCode).Name); } if (GrantAllocationProgramManagers.Any()) { dependentObjects.Add(typeof(GrantAllocationProgramManager).Name); } if (InvoiceLineItems.Any()) { dependentObjects.Add(typeof(InvoiceLineItem).Name); } if (ProjectGrantAllocationExpenditures.Any()) { dependentObjects.Add(typeof(ProjectGrantAllocationExpenditure).Name); } if (ProjectGrantAllocationExpenditureUpdates.Any()) { dependentObjects.Add(typeof(ProjectGrantAllocationExpenditureUpdate).Name); } if (ProjectGrantAllocationRequests.Any()) { dependentObjects.Add(typeof(ProjectGrantAllocationRequest).Name); } if (ProjectGrantAllocationRequestUpdates.Any()) { dependentObjects.Add(typeof(ProjectGrantAllocationRequestUpdate).Name); } return(dependentObjects.Distinct().ToList()); }