What is the IComparable interface?
- Provides a standard method to compare objects for sorting.
class Employee : IComparable<Employee>
public int Id { get; set; }
public int CompareTo(Employee other) =>
this.Id.CompareTo(other.Id);
class Employee : IComparable<Employee>
public int Id { get; set; }
public int CompareTo(Employee other) =>
this.Id.CompareTo(other.Id);