I'm currently using Linq to Sql (dbml) for one of my projects. (c# win forms)
I've created partial and metadata classes, and also implemented Equals() and == based on these Guidelines
the problem I'm having is when I try to use these equals operations within a linq query.
Entities.MyClass.Where(p => p.Equals(myClassObject));
I've also attempted the following
Entities.MyClass.Where(p => Object.Equals(p, myClassObject));
Entities.MyClass.Where(p => p == myClassObject);
What's the best way to implement this?
Instead of attempting to override Equals I'm currently doing the following (but I'm checking 8 values, so it just seems cumbersome) :
Entities.MyClass.Where(p => p.value1 == myClassObject.value1 && p.value2 == myClassObject.value2 ......)