private void ProcessModificationFunction(EntityInfo info, ModificationFunction function)
        {
            if (function == null)
            {
                return;
            }

            // make sure that we don't have any extra scalars (i.e. from entities that are no longer parents of this entity)
            // so gather the list of all SPs we expect to be here
            var expectedMappedProperties = new List<Property>();
            expectedMappedProperties.AddRange(info.KeyProperties);
            expectedMappedProperties.AddRange(info.NonKeyProperties);
            if (info.Parent != null)
            {
                GatherNonKeyPropertiesFromAllParents(info.Parent, expectedMappedProperties);
            }

            // remove any that aren't in our expected list
            foreach (var sp in function.ScalarProperties())
            {
                if (expectedMappedProperties.Contains(sp.Name.Target) == false)
                {
                    AddToDeleteList(sp);
                }
            }

            // make sure that we don't have any extra AssociationEnds
            var cet = info.EntityType;
            Debug.Assert(cet != null, "EntityType is not a ConceptualEntityType");
            var selfAndBaseTypes = new List<ConceptualEntityType>(cet.SafeSelfAndBaseTypes);
            foreach (var end in function.AssociationEnds())
            {
                var from = end.From.Target;
                var to = end.To.Target;
                if (from != null
                    && to != null
                    && from.Role.Target != null
                    && to.Role.Target != null)
                {
                    var fromType = from.Role.Target.Type.Target as ConceptualEntityType;
                    var toType = to.Role.Target.Type.Target as ConceptualEntityType;

                    Debug.Assert(
                        from.Role.Target.Type.Target != null ? fromType != null : true, "fromType EntityType is not a ConceptualEntityType");
                    Debug.Assert(
                        to.Role.Target.Type.Target != null ? toType != null : true, "toType EntityType is not a ConceptualEntityType");

                    if (fromType != null
                        && toType != null)
                    {
                        if (selfAndBaseTypes.Contains(fromType)
                            || selfAndBaseTypes.Contains(toType))
                        {
                            continue;
                        }
                    }
                }

                AddToDeleteList(end);
            }
        }