/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in AgreementPeople.ToList()) { x.DeleteFull(dbContext); } foreach (var x in AuditLogs.ToList()) { x.DeleteFull(dbContext); } foreach (var x in FileResourcesWhereYouAreTheCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GisUploadAttemptsWhereYouAreTheGisUploadAttemptCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationsWhereYouAreTheGrantManager.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationAwardPersonnelAndBenefitsLineItems.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationAwardTravelLineItems.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationChangeLogsWhereYouAreTheChangePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationNotesWhereYouAreTheCreatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationNotesWhereYouAreTheLastUpdatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationNoteInternalsWhereYouAreTheCreatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationNoteInternalsWhereYouAreTheLastUpdatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantAllocationProgramManagers.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantModificationNoteInternalsWhereYouAreTheCreatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantModificationNoteInternalsWhereYouAreTheLastUpdatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantNotesWhereYouAreTheCreatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantNotesWhereYouAreTheLastUpdatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantNoteInternalsWhereYouAreTheCreatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in GrantNoteInternalsWhereYouAreTheLastUpdatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in InteractionEventsWhereYouAreTheStaffPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in InteractionEventContacts.ToList()) { x.DeleteFull(dbContext); } foreach (var x in InvoicesWhereYouAreThePreparedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in Notifications.ToList()) { x.DeleteFull(dbContext); } foreach (var x in OrganizationsWhereYouAreThePrimaryContactPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PerformanceMeasureNotesWhereYouAreTheCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PerformanceMeasureNotesWhereYouAreTheUpdatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PeopleWhereYouAreTheAddedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PersonAllowedAuthenticators.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PersonStewardOrganizations.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PersonStewardRegions.ToList()) { x.DeleteFull(dbContext); } foreach (var x in PersonStewardTaxonomyBranches.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProgramsWhereYouAreTheProgramCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProgramsWhereYouAreTheProgramLastUpdatedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProgramsWhereYouAreTheProgramPrimaryContactPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectsWhereYouAreTheProposingPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectsWhereYouAreTheReviewedByPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectInternalNotesWhereYouAreTheCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectInternalNotesWhereYouAreTheUpdatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectLocationStagings.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectLocationStagingUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectNotesWhereYouAreTheCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectNotesWhereYouAreTheUpdatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectNoteUpdatesWhereYouAreTheCreatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectNoteUpdatesWhereYouAreTheUpdatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectPeople.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectPersonUpdates.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectUpdateBatchesWhereYouAreTheLastUpdatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectUpdateHistoriesWhereYouAreTheUpdatePerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in SupportRequestLogsWhereYouAreTheRequestPerson.ToList()) { x.DeleteFull(dbContext); } foreach (var x in SystemAttributesWhereYouAreThePrimaryContactPerson.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (AgreementPeople.Any()) { dependentObjects.Add(typeof(AgreementPerson).Name); } if (AuditLogs.Any()) { dependentObjects.Add(typeof(AuditLog).Name); } if (FileResourcesWhereYouAreTheCreatePerson.Any()) { dependentObjects.Add(typeof(FileResource).Name); } if (GisUploadAttemptsWhereYouAreTheGisUploadAttemptCreatePerson.Any()) { dependentObjects.Add(typeof(GisUploadAttempt).Name); } if (GrantAllocationsWhereYouAreTheGrantManager.Any()) { dependentObjects.Add(typeof(GrantAllocation).Name); } if (GrantAllocationAwardPersonnelAndBenefitsLineItems.Any()) { dependentObjects.Add(typeof(GrantAllocationAwardPersonnelAndBenefitsLineItem).Name); } if (GrantAllocationAwardTravelLineItems.Any()) { dependentObjects.Add(typeof(GrantAllocationAwardTravelLineItem).Name); } if (GrantAllocationChangeLogsWhereYouAreTheChangePerson.Any()) { dependentObjects.Add(typeof(GrantAllocationChangeLog).Name); } if (GrantAllocationNotesWhereYouAreTheCreatedByPerson.Any()) { dependentObjects.Add(typeof(GrantAllocationNote).Name); } if (GrantAllocationNotesWhereYouAreTheLastUpdatedByPerson.Any()) { dependentObjects.Add(typeof(GrantAllocationNote).Name); } if (GrantAllocationNoteInternalsWhereYouAreTheCreatedByPerson.Any()) { dependentObjects.Add(typeof(GrantAllocationNoteInternal).Name); } if (GrantAllocationNoteInternalsWhereYouAreTheLastUpdatedByPerson.Any()) { dependentObjects.Add(typeof(GrantAllocationNoteInternal).Name); } if (GrantAllocationProgramManagers.Any()) { dependentObjects.Add(typeof(GrantAllocationProgramManager).Name); } if (GrantModificationNoteInternalsWhereYouAreTheCreatedByPerson.Any()) { dependentObjects.Add(typeof(GrantModificationNoteInternal).Name); } if (GrantModificationNoteInternalsWhereYouAreTheLastUpdatedByPerson.Any()) { dependentObjects.Add(typeof(GrantModificationNoteInternal).Name); } if (GrantNotesWhereYouAreTheCreatedByPerson.Any()) { dependentObjects.Add(typeof(GrantNote).Name); } if (GrantNotesWhereYouAreTheLastUpdatedByPerson.Any()) { dependentObjects.Add(typeof(GrantNote).Name); } if (GrantNoteInternalsWhereYouAreTheCreatedByPerson.Any()) { dependentObjects.Add(typeof(GrantNoteInternal).Name); } if (GrantNoteInternalsWhereYouAreTheLastUpdatedByPerson.Any()) { dependentObjects.Add(typeof(GrantNoteInternal).Name); } if (InteractionEventsWhereYouAreTheStaffPerson.Any()) { dependentObjects.Add(typeof(InteractionEvent).Name); } if (InteractionEventContacts.Any()) { dependentObjects.Add(typeof(InteractionEventContact).Name); } if (InvoicesWhereYouAreThePreparedByPerson.Any()) { dependentObjects.Add(typeof(Invoice).Name); } if (Notifications.Any()) { dependentObjects.Add(typeof(Notification).Name); } if (OrganizationsWhereYouAreThePrimaryContactPerson.Any()) { dependentObjects.Add(typeof(Organization).Name); } if (PerformanceMeasureNotesWhereYouAreTheCreatePerson.Any()) { dependentObjects.Add(typeof(PerformanceMeasureNote).Name); } if (PerformanceMeasureNotesWhereYouAreTheUpdatePerson.Any()) { dependentObjects.Add(typeof(PerformanceMeasureNote).Name); } if (PeopleWhereYouAreTheAddedByPerson.Any()) { dependentObjects.Add(typeof(Person).Name); } if (PersonAllowedAuthenticators.Any()) { dependentObjects.Add(typeof(PersonAllowedAuthenticator).Name); } if (PersonStewardOrganizations.Any()) { dependentObjects.Add(typeof(PersonStewardOrganization).Name); } if (PersonStewardRegions.Any()) { dependentObjects.Add(typeof(PersonStewardRegion).Name); } if (PersonStewardTaxonomyBranches.Any()) { dependentObjects.Add(typeof(PersonStewardTaxonomyBranch).Name); } if (ProgramsWhereYouAreTheProgramCreatePerson.Any()) { dependentObjects.Add(typeof(Program).Name); } if (ProgramsWhereYouAreTheProgramLastUpdatedByPerson.Any()) { dependentObjects.Add(typeof(Program).Name); } if (ProgramsWhereYouAreTheProgramPrimaryContactPerson.Any()) { dependentObjects.Add(typeof(Program).Name); } if (ProjectsWhereYouAreTheProposingPerson.Any()) { dependentObjects.Add(typeof(Project).Name); } if (ProjectsWhereYouAreTheReviewedByPerson.Any()) { dependentObjects.Add(typeof(Project).Name); } if (ProjectInternalNotesWhereYouAreTheCreatePerson.Any()) { dependentObjects.Add(typeof(ProjectInternalNote).Name); } if (ProjectInternalNotesWhereYouAreTheUpdatePerson.Any()) { dependentObjects.Add(typeof(ProjectInternalNote).Name); } if (ProjectLocationStagings.Any()) { dependentObjects.Add(typeof(ProjectLocationStaging).Name); } if (ProjectLocationStagingUpdates.Any()) { dependentObjects.Add(typeof(ProjectLocationStagingUpdate).Name); } if (ProjectNotesWhereYouAreTheCreatePerson.Any()) { dependentObjects.Add(typeof(ProjectNote).Name); } if (ProjectNotesWhereYouAreTheUpdatePerson.Any()) { dependentObjects.Add(typeof(ProjectNote).Name); } if (ProjectNoteUpdatesWhereYouAreTheCreatePerson.Any()) { dependentObjects.Add(typeof(ProjectNoteUpdate).Name); } if (ProjectNoteUpdatesWhereYouAreTheUpdatePerson.Any()) { dependentObjects.Add(typeof(ProjectNoteUpdate).Name); } if (ProjectPeople.Any()) { dependentObjects.Add(typeof(ProjectPerson).Name); } if (ProjectPersonUpdates.Any()) { dependentObjects.Add(typeof(ProjectPersonUpdate).Name); } if (ProjectUpdateBatchesWhereYouAreTheLastUpdatePerson.Any()) { dependentObjects.Add(typeof(ProjectUpdateBatch).Name); } if (ProjectUpdateHistoriesWhereYouAreTheUpdatePerson.Any()) { dependentObjects.Add(typeof(ProjectUpdateHistory).Name); } if (SupportRequestLogsWhereYouAreTheRequestPerson.Any()) { dependentObjects.Add(typeof(SupportRequestLog).Name); } if (SystemAttributesWhereYouAreThePrimaryContactPerson.Any()) { dependentObjects.Add(typeof(SystemAttribute).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(AgreementPeople.Any() || AuditLogs.Any() || FileResourcesWhereYouAreTheCreatePerson.Any() || GisUploadAttemptsWhereYouAreTheGisUploadAttemptCreatePerson.Any() || GrantAllocationsWhereYouAreTheGrantManager.Any() || GrantAllocationAwardPersonnelAndBenefitsLineItems.Any() || GrantAllocationAwardTravelLineItems.Any() || GrantAllocationChangeLogsWhereYouAreTheChangePerson.Any() || GrantAllocationNotesWhereYouAreTheCreatedByPerson.Any() || GrantAllocationNotesWhereYouAreTheLastUpdatedByPerson.Any() || GrantAllocationNoteInternalsWhereYouAreTheCreatedByPerson.Any() || GrantAllocationNoteInternalsWhereYouAreTheLastUpdatedByPerson.Any() || GrantAllocationProgramManagers.Any() || GrantModificationNoteInternalsWhereYouAreTheCreatedByPerson.Any() || GrantModificationNoteInternalsWhereYouAreTheLastUpdatedByPerson.Any() || GrantNotesWhereYouAreTheCreatedByPerson.Any() || GrantNotesWhereYouAreTheLastUpdatedByPerson.Any() || GrantNoteInternalsWhereYouAreTheCreatedByPerson.Any() || GrantNoteInternalsWhereYouAreTheLastUpdatedByPerson.Any() || InteractionEventsWhereYouAreTheStaffPerson.Any() || InteractionEventContacts.Any() || InvoicesWhereYouAreThePreparedByPerson.Any() || Notifications.Any() || OrganizationsWhereYouAreThePrimaryContactPerson.Any() || PerformanceMeasureNotesWhereYouAreTheCreatePerson.Any() || PerformanceMeasureNotesWhereYouAreTheUpdatePerson.Any() || PeopleWhereYouAreTheAddedByPerson.Any() || PersonAllowedAuthenticators.Any() || PersonStewardOrganizations.Any() || PersonStewardRegions.Any() || PersonStewardTaxonomyBranches.Any() || ProgramsWhereYouAreTheProgramCreatePerson.Any() || ProgramsWhereYouAreTheProgramLastUpdatedByPerson.Any() || ProgramsWhereYouAreTheProgramPrimaryContactPerson.Any() || ProjectsWhereYouAreTheProposingPerson.Any() || ProjectsWhereYouAreTheReviewedByPerson.Any() || ProjectInternalNotesWhereYouAreTheCreatePerson.Any() || ProjectInternalNotesWhereYouAreTheUpdatePerson.Any() || ProjectLocationStagings.Any() || ProjectLocationStagingUpdates.Any() || ProjectNotesWhereYouAreTheCreatePerson.Any() || ProjectNotesWhereYouAreTheUpdatePerson.Any() || ProjectNoteUpdatesWhereYouAreTheCreatePerson.Any() || ProjectNoteUpdatesWhereYouAreTheUpdatePerson.Any() || ProjectPeople.Any() || ProjectPersonUpdates.Any() || ProjectUpdateBatchesWhereYouAreTheLastUpdatePerson.Any() || ProjectUpdateHistoriesWhereYouAreTheUpdatePerson.Any() || SupportRequestLogsWhereYouAreTheRequestPerson.Any() || SystemAttributesWhereYouAreThePrimaryContactPerson.Any()); }
/// <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()); }