public bool Equals(ModelWithIdAndName other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(other.Id == this.Id && Equals(other.Name, this.Name)); }