src/Misc/EFTools/XmlCore/Model/Eventing/EfiChangeComparer.cs
/// <summary>
///     Sort changes so that Deletes are first, creates are second and updates are third.
///     For example: Sort updates to process EntityType first, then Associaiton, then others.
///     Sort is stable (i.e. it is preserving order of items that have equal values).
///     This is acomplished by comparing original position of items for which GetVal() returned same value.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
Sort changes so that Deletes are first, creates are second and updates are third.
For example: Sort updates to process EntityType first, then Associaiton, then others.
Sort is stable .
This is acomplished by comparing original position of items for which GetVal() returned same value.
Sort changes so that Deletes are first creates are second and updates are third . For example : Sort updates to process EntityType first then Associaiton then others . Sort is stable . This is acomplished by comparing original position of items for which GetVal () returned same value .
public int Compare(EfiChangeStableSortItem x, EfiChangeStableSortItem y)
        {
            var xval = GetVal(x.EfiChange);
            var yval = GetVal(y.EfiChange);
            if (xval > yval)
            {
                return 1;
            }
            else if (xval < yval)
            {
                return -1;
            }
            else
            {
                if (x.Position > y.Position)
                {
                    return 1;
                }
                else if (x.Position < y.Position)
                {
                    return -1;
                }
                else
                {
                    return 0;
                }
            }
        }
public int Compare ( EfiChangeStableSortItem x , EfiChangeStableSortItem y ) { var xval = GetVal ( x . EfiChange ) ; var yval = GetVal ( y . EfiChange ) ; if ( xval > yval ) { return 1 ; } else if ( xval < yval ) { return - 1 ; } else { if ( x . Position > y . Position ) { return 1 ; } else if ( x . Position < y . Position ) { return - 1 ; } else { return 0 ; } } }
Sort changes so that Deletes are first, creates are second and updates are third.
Sort changes so that Deletes are first creates are second and updates are third .
None
x
EfiChangeStableSortItem
None
y
EfiChangeStableSortItem
None