Skip to content

Instantly share code, notes, and snippets.

@sasan-salem
Created March 31, 2021 13:21
Show Gist options
  • Save sasan-salem/79d1de0ae999b39f8e2fb8567d57d1fe to your computer and use it in GitHub Desktop.
Save sasan-salem/79d1de0ae999b39f8e2fb8567d57d1fe to your computer and use it in GitHub Desktop.
List<Student> students = new List<Student>();
// Add some students to this List
var specificStudent = new Student() { SerialNo = 12, Number = 34, Grade = 3, Name = "Joe" };
bool exist1 = students.Contains(specificStudent, new NumberEqualityComparer());
bool exist2 = students.Contains(specificStudent, new SerialNoEqualityComparer());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment