private void SaveDeletedInformation()
        {
            DeletedEntityTypeName = EntityType.Name.Value;

            // Collect all of the mapped storage property names in case we need to 
            var deletedStoragePropertyNames = new HashSet<EntityQualifiedPropertyName>();
            foreach (var cProp in EntityType.Properties())
            {
                var scalarProperties = cProp.GetAntiDependenciesOfType<ScalarProperty>();
                foreach (var scalarProperty in scalarProperties)
                {
                    var storageProperty = (StorageProperty)scalarProperty.ColumnName.Target;
                    if (storageProperty != null
                        && storageProperty.EntityType != null)
                    {
                        var entityToPropertyName = new EntityQualifiedPropertyName(
                            storageProperty.EntityType.Name.Value, storageProperty.Name.Value, false);
                        if (!deletedStoragePropertyNames.Contains(entityToPropertyName))
                        {
                            deletedStoragePropertyNames.Add(entityToPropertyName);
                        }
                    }
                }
            }
            DeletedMappedStoragePropertyNames = deletedStoragePropertyNames;
        }
예제 #2
0
        private void SaveDeletedInformation()
        {
            DeletedEntityTypeName = EntityType.Name.Value;

            // Collect all of the mapped storage property names in case we need to
            var deletedStoragePropertyNames = new HashSet <EntityQualifiedPropertyName>();

            foreach (var cProp in EntityType.Properties())
            {
                var scalarProperties = cProp.GetAntiDependenciesOfType <ScalarProperty>();
                foreach (var scalarProperty in scalarProperties)
                {
                    var storageProperty = (StorageProperty)scalarProperty.ColumnName.Target;
                    if (storageProperty != null &&
                        storageProperty.EntityType != null)
                    {
                        var entityToPropertyName = new EntityQualifiedPropertyName(
                            storageProperty.EntityType.Name.Value, storageProperty.Name.Value, false);
                        if (!deletedStoragePropertyNames.Contains(entityToPropertyName))
                        {
                            deletedStoragePropertyNames.Add(entityToPropertyName);
                        }
                    }
                }
            }
            DeletedMappedStoragePropertyNames = deletedStoragePropertyNames;
        }