src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Sort the properties in the order of the properties' XElement in the XDocument.
/// </summary>
/// <returns></returns>
Sort the properties in the order of the properties' XElement in the XDocument.
Sort the properties in the order of the properties ' XElement in the XDocument .
internal static IList<T> GetListOfPropertiesInTheirXElementsOrder<T>(IList<T> properties) where T : PropertyBase
        {
            IList<T> sortedProperties = new List<T>();
            if (properties != null
                && properties.Count > 0)
            {
                var property = properties[0];
                while (property.PreviousSiblingInPropertyXElementOrder != null)
                {
                    property = property.PreviousSiblingInPropertyXElementOrder as T;
                }
                while (property != null)
                {
                    if (properties.Contains(property))
                    {
                        sortedProperties.Add(property);
                    }
                    property = property.NextSiblingInPropertyXElementOrder as T;
                }
            }
            return sortedProperties;
        }
internal static IList < T > GetListOfPropertiesInTheirXElementsOrder < T > ( IList < T > properties ) where T : PropertyBase { IList < T > sortedProperties = new List < T > ( ) ; if ( properties != null && properties . Count > 0 ) { var property = properties [ 0 ] ; while ( property . PreviousSiblingInPropertyXElementOrder != null ) { property = property . PreviousSiblingInPropertyXElementOrder as T ; } while ( property != null ) { if ( properties . Contains ( property ) ) { sortedProperties . Add ( property ) ; } property = property . NextSiblingInPropertyXElementOrder as T ; } } return sortedProperties ; }
Sort the properties in the order of the properties' XElement in the XDocument.
Sort the properties in the order of the properties ' XElement in the XDocument .
// Move to the first property. // Traverse the properties in the entity and if the property is what we want to move, add it to the sorted list.
None
properties
IList<T>