List.Contains is not working as hoped

Posted by VoodooChild on Stack Overflow See other posts from Stack Overflow or by VoodooChild
Published on 2010-06-02T16:23:42Z Indexed on 2010/06/02 16:34 UTC
Read the original article Hit count: 167

Filed under:
|
|

If I have an object of type MyBull and a List<MyBull>:

// Just an example
MyBull x = getMeTheObjectWithIdFromDB(9);

orig.add(x);

// Again same? data object
MyBull y = getMeTheObjectWithIdFromDB(9);

Why is this false then?

// This is false, even though all the properties
// of x and y are the same.
orig.Contains<MyBull>(y); 

© Stack Overflow or respective owner

Related posts about c#

Related posts about list