Re: Newbie question about object comparisons

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You have probably already figured this out, but for the benefit of such
posterity as there is in a usenet group :-)

> However, in the business problem I'm trying to solve, the 'keys' are
not always
> strings. Indeed, I've got half a dozen custom objects that need to be
compared.

In that case I amend my recommended solution: use the Equals method.
The CLR will figure out (via virtual methods and overriding) which is
the correct Equals to call to compare your two keys.

.



Relevant Pages