/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in GisUploadSourceOrganizations.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProgramPeople.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectLocations.ToList()) { x.DeleteFull(dbContext); } foreach (var x in ProjectPrograms.ToList()) { x.DeleteFull(dbContext); } foreach (var x in Treatments.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (GisUploadSourceOrganizations.Any()) { dependentObjects.Add(typeof(GisUploadSourceOrganization).Name); } if (ProgramPeople.Any()) { dependentObjects.Add(typeof(ProgramPerson).Name); } if (ProjectLocations.Any()) { dependentObjects.Add(typeof(ProjectLocation).Name); } if (ProjectPrograms.Any()) { dependentObjects.Add(typeof(ProjectProgram).Name); } if (Treatments.Any()) { dependentObjects.Add(typeof(Treatment).Name); } return(dependentObjects.Distinct().ToList()); }
/// <summary> /// Dependent type names of this entity /// </summary> public void DeleteChildren(DatabaseEntities dbContext) { foreach (var x in GisUploadSourceOrganizations.ToList()) { x.DeleteFull(dbContext); } }
/// <summary> /// Active Dependent type names of this object /// </summary> public List <string> DependentObjectNames() { var dependentObjects = new List <string>(); if (GisUploadSourceOrganizations.Any()) { dependentObjects.Add(typeof(GisUploadSourceOrganization).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(GisUploadSourceOrganizations.Any() || ProgramPeople.Any() || ProjectLocations.Any() || ProjectPrograms.Any() || Treatments.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(GisUploadSourceOrganizations.Any()); }