src/Shared/EntityFramework/Internal/SortableBindingList`.cs
// <summary>
// Compares two instances of items in the list.
// </summary>
// <param name="left"> The left item to compare. </param>
// <param name="right"> The right item to compare. </param>
Compares two instances of items in the list.
Compares two instances of items in the list .
public override int Compare(T left, T right)
            {
                var leftValue = _prop.GetValue(left);
                var rightValue = _prop.GetValue(right);
                if (_useToString)
                {
                    leftValue = leftValue != null ? leftValue.ToString() : null;
                    rightValue = rightValue != null ? rightValue.ToString() : null;
                }
                return _direction == ListSortDirection.Ascending
                           ? _comparer.Compare(leftValue, rightValue)
                           : _comparer.Compare(rightValue, leftValue);
            }
public override int Compare ( T left , T right ) { var leftValue = _prop . GetValue ( left ) ; var rightValue = _prop . GetValue ( right ) ; if ( _useToString ) { leftValue = leftValue != null ? leftValue . ToString ( ) : null ; rightValue = rightValue != null ? rightValue . ToString ( ) : null ; } return _direction == ListSortDirection . Ascending ? _comparer . Compare ( leftValue , rightValue ) : _comparer . Compare ( rightValue , leftValue ) ; }
Compares two instances of items in the list.
Compares two instances of items in the list .
left
T
The left item to compare.
The left item to compare .
right
T
The right item to compare.
The right item to compare .