473,378 Members | 1,134 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,378 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 1351
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.