internal static bool HasChanges(IDictionary <string, EntityProperty> originalProperties,
                                        IDictionary <string, EntityProperty> currentProperties)
        {
            if (originalProperties.Keys.Count != currentProperties.Keys.Count)
            {
                return(true);
            }

            if (!Enumerable.SequenceEqual(originalProperties.Keys, currentProperties.Keys))
            {
                return(true);
            }

            foreach (string key in currentProperties.Keys)
            {
                EntityProperty originalValue = originalProperties[key];
                EntityProperty newValue      = currentProperties[key];

                if (originalValue == null)
                {
                    if (newValue != null)
                    {
                        return(true);
                    }
                    else
                    {
                        continue;
                    }
                }

                if (!originalValue.Equals(newValue))
                {
                    return(true);
                }
            }

            return(false);
        }