c# - Contains() method of List<T> -


In short, which methods in a class list & lt; T & gt; To operate of

I have overloaded == in my class but it has no effect.

This will only call equals () - all that override (Or not, if you are happy with reference identification comparison) if type iequatable & lt; T & gt; , then that implementation will be used in the priority of the normal identical .

Specifically, for documentation from:

This method determines the similarity using the default similarity comparison equality compass (t). The default for T , type of values ​​in the list.

and from:

defaults checks for the property to implement what type T Is System The IEquatable (T) normal interface and if this happens, then a equity compairer (t) which uses the implementation otherwise it is a equity compartment (t) < / Code> that uses the object. T provided by AVWOLS and Object.GetHashCode .

I do not believe it will use it at GetHashCode at all.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -