public int CompareTo(object obj) //нужна проверка на null и на соответствие типа (иначе as вернёт null) { People p = obj as People; return(string.Compare(this.Name, p.Name)); }
public int CompareTo(object obj) { People p = obj as People; return(string.Compare(this.Name, p.Name)); }