>When you are using a Dictionary object what type is to possible to have on
>the key?
AFIK any!
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Tony" <johansson.ande rsson@telia.com schrieb im Newsbeitrag
news:uljieRR0IH A.2384@TK2MSFTN GP02.phx.gbl...
Hello!
>
When you are using a Dictionary object what type is to possible to have on
the key?
>
//Tony
>
>
On Jun 18, 8:31 am, "Tony" <johansson.ande rs...@telia.com wrote:
When you are using a Dictionary object what type is to possible to have on
the key?
Anything. If it's a reference type and doesn't override Equals/
GetHashCode then you'll only get an identity look-up (unless you
specify a separate IEqualityCompar er), and it's generally a bad idea
to use mutable types as keys, but that's it really.
"Kerem Gümrükcü" <kareem114@hotm ail.comskrev i meddelandet
news:OeZqDWR0IH A.4084@TK2MSFTN GP05.phx.gbl...
Hi Toni,
>
When you are using a Dictionary object what type is to possible to have
on
the key?
>
AFIK any!
>
>
Regards
>
Kerem
>
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Tony" <johansson.ande rsson@telia.com schrieb im Newsbeitrag
news:uljieRR0IH A.2384@TK2MSFTN GP02.phx.gbl...
Hello!
When you are using a Dictionary object what type is to possible to have
On Jun 18, 12:44 pm, "Tony" <johansson.ande rs...@telia.com wrote:
Hello!
>
But how is that done if a class is used as a key?
>
//Tony
>
"Kerem Gümrükcü" <kareem...@hotm ail.comskrev i meddelandetnews :OeZqDWR0IHA.40 84@TK2MSFTNGP05 .phx.gbl...
>
>
>
Hi Toni,
>
>When you are using a Dictionary object what type is to possible to have
on
>the key?
>
AFIK any!
>
Regards
>
Kerem
>
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:http://kerem-g.spaces.live.com/
Latest Open-Source Projects:http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Tony" <johansson.ande rs...@telia.com schrieb im Newsbeitrag
news:uljieRR0IH A.2384@TK2MSFTN GP02.phx.gbl...
Hello!
>
When you are using a Dictionary object what type is to possible to have
on
the key?
>
//Tony- Hide quoted text -
>
- Show quoted text -
Dictionary allows object as key, I think while retrieving the value
from dictionary, it uses HashCode of the object.
Anything fishey or you are expecting a BUG in baseclass library?
Comment