/// <summary> /// the reservation can be comapred with another reservation or with integer /// </summary> public int CompareTo(object obj) { if (obj is Reservation) { return(ReservationID.CompareTo(((Reservation)(obj)).ReservationID)); } else if (obj is int) { return(ReservationID.CompareTo(obj)); } else { throw new ArgumentException("obj must be \"Reservation\" or int."); } }