public int CompareTo(object reference) { if ((reference is ChannelPairGuid) == false) { throw new ArgumentException( $@"Unable to compare with unequivalent type: {reference.GetType()}", nameof(reference)); } var compareTo = (ChannelPairGuid)reference; var firstCompare = InputChannel.CompareTo(compareTo.InputChannel); if (firstCompare != 0) { return(firstCompare); } return(OutputChannel.CompareTo(compareTo.OutputChannel)); }