I have these two objects (dummy code)
var students = new List<Student>();
var girl = new Student() { Name = "Simran", StudentId = 4 };
var sameGirl = new Student() { Name = "Norman", StudentId = 4 };
I wanted to check if these two objects are the same using the Intersect
method but to my understanding Intersect
uses Equals
under the hood so these two objects will evaluate to false, I don't really know how to override the Equals
or Intersect
methods, but in essence, I want to check if the Ids of the objects are the same. Can the Equals
or Intersect
method be overridden to evaluate a part of the object, not the whole object?