Esempio n. 1
0
        public int Compare(SoodaObject dbo1, SoodaObject dbo2)
        {
            object v1 = dbo1.Evaluate(_propertyChain, false);
            object v2 = dbo2.Evaluate(_propertyChain, false);

            if (_sortOrder == SortOrder.Ascending)
            {
                return(DoCompare(v1, v2, dbo1, dbo2));
            }
            else
            {
                return(-DoCompare(v1, v2, dbo1, dbo2));
            }
        }
Esempio n. 2
0
        public int Compare(SoodaObject dbo1, SoodaObject dbo2)
        {
            foreach (FieldCompareInfo fci in fields)
            {
                object v1 = dbo1.Evaluate(fci.propertyChain, false);
                object v2 = dbo2.Evaluate(fci.propertyChain, false);

                int result = DoCompare(v1, v2);
                if (result != 0)
                {
                    if (fci.sortOrder == SortOrder.Ascending)
                    {
                        return(result);
                    }
                    else
                    {
                        return(-result);
                    }
                }
            }

            return(PrimaryKeyCompare(dbo1, dbo2));
        }