Пример #1
0
        public int CompareTo(SplitTimeModel other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var raceDataIdComparison = RaceDataId.CompareTo(other.RaceDataId);

            if (raceDataIdComparison != 0)
            {
                return(raceDataIdComparison);
            }
            var runNoComparison = RunNo.CompareTo(other.RunNo);

            if (runNoComparison != 0)
            {
                return(runNoComparison);
            }
            var splittimeNoComparison = SplitTimeNo.CompareTo(other.SplitTimeNo);

            if (splittimeNoComparison != 0)
            {
                return(splittimeNoComparison);
            }
            return(Time.CompareTo(other.Time));
        }
Пример #2
0
        public int CompareTo(Run other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var raceIdComparison = RaceId.CompareTo(other.RaceId);

            if (raceIdComparison != 0)
            {
                return(raceIdComparison);
            }
            var runNoComparison = RunNo.CompareTo(other.RunNo);

            if (runNoComparison != 0)
            {
                return(runNoComparison);
            }
            var runningComparison = Running.CompareTo(other.Running);

            if (runningComparison != 0)
            {
                return(runningComparison);
            }
            return(Finished.CompareTo(other.Finished));
        }