DotNetBlog der DotNet-Blog Alles rund um Microsoft .NET – von  Sascha H. Baumann

C#: Lookup vs. Dictionary

1 Star2 Stars3 Stars4 Stars5 Stars (Noch nicht bewertet. Seien Sie der/die Erste !)
Loading ... Loading ...

The main difference between the Generic Classes Lookup and Dictionary is the uniqueness of the Key. While Dictionarys can only have a Key-Value once,
in Lookup it can occur multiple times.

Declaration is the same.

Lookup<int,string> myLookup = new Lookup<int,string>();

vs.

Dictionary<int,string> myDic = new Dictionary<int,string>();

Furter Reading:

* A nice article about using ToDictionary and ToLookup in Linq can be found @blog.donnfelker.com

Share and Enjoy:
  • Digg
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • MisterWong.DE
  • Technorati
  • Webnews.de
  • YahooMyWeb

3 Antworten zu “C#: Lookup vs. Dictionary”

  1. Rainer Hilmer Sagt:

    Does anybody know the .net framework completely? Well, I have to admit I don’t. It’s the first time I read about Lookup(of T). So thank you for the hint. :-)

  2. Marco Scheel Sagt:

    Hi,

    greetings from offenbach. Never heard of loopups… maybe you should correct it to lookups ;-) … but as rainer said…. never heard of lookups too. great info.

    Ciao Marco

  3. admin Sagt:

    Thanks Marco, how did this happen ? damn ;o)

    I never heard of them, too – always used Collection of KeyValue Pairs for this kind of stuff.

    Greetings from Berlin to Offenbach
    Sascha

Hinterlasse eine Antwort

CAPTCHA-Bild CAPTCHA Audio
Bild neuladen

Bad Behavior has blocked 35 access attempts in the last 7 days.