473,238 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

Dictionary<K,V>

Hello!

When you are using a Dictionary object what type is to possible to have on
the key?

//Tony
Jun 27 '08 #1
6 1346
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" <jo*****************@telia.comschrieb im Newsbeitrag
news:ul**************@TK2MSFTNGP02.phx.gbl...
Hello!

When you are using a Dictionary object what type is to possible to have on
the key?

//Tony


Jun 27 '08 #2
On Jun 18, 8:31 am, "Tony" <johansson.anders...@telia.comwrote:
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 IEqualityComparer), and it's generally a bad idea
to use mutable types as keys, but that's it really.

Jon
Jun 27 '08 #3
Hello!

But how is that done if a class is used as a key?

//Tony

"Kerem Gümrükcü" <ka*******@hotmail.comskrev i meddelandet
news:Oe**************@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" <jo*****************@telia.comschrieb im Newsbeitrag
news:ul**************@TK2MSFTNGP02.phx.gbl...
Hello!

When you are using a Dictionary object what type is to possible to have
on
the key?

//Tony


Jun 27 '08 #4
On Jun 18, 8:44*am, "Tony" <johansson.anders...@telia.comwrote:
But how is that done if a class is used as a key?
What do you mean? Why would you expect it not to work?

Jon
Jun 27 '08 #5
On Jun 18, 12:44*pm, "Tony" <johansson.anders...@telia.comwrote:
Hello!

But how is that done if a class is used as a key?

//Tony

"Kerem Gümrükcü" <kareem...@hotmail.comskrev i meddelandetnews:Oe**************@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.anders...@telia.comschrieb im Newsbeitrag
news:ul**************@TK2MSFTNGP02.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?

-Cnu.
Jun 27 '08 #6
On Wed, 18 Jun 2008 02:57:34 -0700 (PDT), Duggi
<Du***************@gmail.comwrote:
>On Jun 18, 12:44*pm, "Tony" <johansson.anders...@telia.comwrote:
>Hello!

But how is that done if a class is used as a key?
Do you mean class as in typeof(someClass)?

Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ESPNSTI | last post by:
Hi, I'm trying to use a generics dictionary with a key class that implements and needs IComparable<>. However when I attempt to use the dictionary, it doesn't appear to use the IComparable<> to...
6
by: buzzweetman | last post by:
Many times I have a Dictionary<string, SomeTypeand need to get the list of keys out of it as a List<string>, to pass to a another method that expects a List<string>. I often do the following: ...
7
by: Andrew Robinson | last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v> depending on input parameters and options to the method. 1. Is there any way to convert from a dictionary to a list...
2
by: Assimalyst | last post by:
Hi I have a Dictionary<string, List<string>>, which i have successfully filled. My problem is I need to create a filter expression using all possible permutations of its contents. i.e. the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.