Esempio n. 1
0
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (GeospatialAreas.Any())
            {
                dependentObjects.Add(typeof(GeospatialArea).Name);
            }

            if (GeospatialAreaRawDatas.Any())
            {
                dependentObjects.Add(typeof(GeospatialAreaRawData).Name);
            }

            if (GeospatialAreaTypesWhereYouAreTheEsuDpsGeospatialAreaType.Any())
            {
                dependentObjects.Add(typeof(GeospatialAreaType).Name);
            }

            if (GeospatialAreaTypesWhereYouAreTheMPGGeospatialAreaType.Any())
            {
                dependentObjects.Add(typeof(GeospatialAreaType).Name);
            }

            if (GeospatialAreaTypesWhereYouAreThePopulationGeospatialAreaType.Any())
            {
                dependentObjects.Add(typeof(GeospatialAreaType).Name);
            }

            if (ProjectCustomGridConfigurations.Any())
            {
                dependentObjects.Add(typeof(ProjectCustomGridConfiguration).Name);
            }

            if (ProjectGeospatialAreaTypeNotes.Any())
            {
                dependentObjects.Add(typeof(ProjectGeospatialAreaTypeNote).Name);
            }

            if (ProjectGeospatialAreaTypeNoteUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectGeospatialAreaTypeNoteUpdate).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
Esempio n. 2
0
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in GeospatialAreas.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in GeospatialAreaRawDatas.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in GeospatialAreaTypesWhereYouAreTheEsuDpsGeospatialAreaType.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in GeospatialAreaTypesWhereYouAreTheMPGGeospatialAreaType.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in GeospatialAreaTypesWhereYouAreThePopulationGeospatialAreaType.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectCustomGridConfigurations.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectGeospatialAreaTypeNotes.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectGeospatialAreaTypeNoteUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
Esempio n. 3
0
 /// <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(GeospatialAreas.Any() || GeospatialAreaRawDatas.Any() || GeospatialAreaTypesWhereYouAreTheEsuDpsGeospatialAreaType.Any() || GeospatialAreaTypesWhereYouAreTheMPGGeospatialAreaType.Any() || GeospatialAreaTypesWhereYouAreThePopulationGeospatialAreaType.Any() || ProjectCustomGridConfigurations.Any() || ProjectGeospatialAreaTypeNotes.Any() || ProjectGeospatialAreaTypeNoteUpdates.Any());
 }