From the course: C# Essential Training 2: Generics, Collections, and LINQ
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Working with keyed collections - C# Tutorial
From the course: C# Essential Training 2: Generics, Collections, and LINQ
Working with keyed collections
- [Instructor] We're back in our collection samples file here, but I have updated it with some code. So you may want to go to the begin directory for this particular movie, and load that up if you want to follow along. I've added this dictionary method. I'm going to show you how to work with those generic dictionaries. You can see here on line 115, I've created a generic dictionary where the key type is string, and the value type is person. Meaning the key, what we're going to use to uniquely identify this item, and look it up or index it is a string, and what we're going to get back or put into this dictionary as a person. So the dictionary gives us this really great way to store a set of items, but to have that unique key to go, and work with that specific item. So we don't need to know it's position in there, we don't need to go find it. We can directly access it by that key. And then on the next few lines,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Understanding collection types in the BCL6m 44s
-
(Locked)
Choosing the right collection type5m 48s
-
(Locked)
Working with collections8m 15s
-
(Locked)
Working with keyed collections7m 11s
-
(Locked)
Understanding concurrent collections3m 53s
-
(Locked)
Solution: Choose the right collection2m 9s
-
(Locked)
-
-
-
-
-
-