Beginning C# 7 Collections
Almost every app requires data to be stored in collections. This course gives you a basic introduction, covering the most widely used collections - arrays, lists, and dictionaries - and gets you up to speed with querying and modifying data in them.
What you'll learn
Collections are essential to store almost any real data in apps, but the vast number of different collections can be confusing.
In this course, Beginning C# Collections, you will gain the ability to leverage the most commonly used collections to query data.
First, you will learn how and when to use the three most widely used collections to group data together:
- Arrays
- Lists
- Dictionaries
Finally, you will explore how to put collections inside other collections to accomplish tasks such as partitioning data.
When you're finished with this course, you will have the skills to store data in collections, and to look up, enumerate, query, and modify that data using the collections in a variety of simple scenarios.
Table of contents
- Version Check 0m
- Overview 1m
- What Is a Collection? 2m
- The Array: A Fixed Size Ordered Collection 2m
- Enumerating an Array 4m
- Some Collection Terminology 1m
- Looking up Array Items 4m
- Arrays Are Zero-indexed 3m
- Collections Are Safe 1m
- Converting Between Zero-based and One-based Indexing 2m
- Replacing Array Items 3m
- Debugging with Arrays 2m
- From Arrays to Other Collections 1m
- Summary 1m
- Overview 1m
- The Demo Sample: Importing Countries 4m
- You Can't Enumerate Null 1m
- Instantiating an Array by Size 4m
- The CSV Data Source 2m
- Parsing a CSV Line with String.Split() 4m
- Arrays and Params Arguments 2m
- Populating the Array with a For Loop 3m
- Formatting the Large Numbers 3m
- Instantiating an Array: Review 3m
- Summary 1m
- Overview 1m
- Arrays Are a Fixed Size 2m
- Introducing List<T> 2m
- Adding Items with List<T>.Add() and Collection Intializers 2m
- List<T> Is a Generic Type 1m
- Importing from the CSV File into a List 3m
- Enumerating a List 1m
- CSV Embedded Commas 2m
- Counting Elements with Array.Length 3m
- Counting Elements with List<T>.Count 1m
- Inserting with List<T>.Insert() 2m
- Searching with List<T>.FindIndex() 4m
- Removing with List<T>.RemoveAt() 2m
- Lists and Performance 1m
- Summary 1m
- Overview 1m
- Lists and Arrays Require an Index 2m
- Introducing Dictionary<TKey, TValue> 2m
- Instantiating a Dictionary 2m
- Adding Items to a Dictionary with Add() 2m
- Using Keys to Look up Dictionary Items 2m
- Enumerating Dictionary Items 2m
- Understanding KeyValuePair<TKey, TValue> 2m
- Dictionary Initializers 2m
- Keys Are Unique! 2m
- The Uncertainty of Dictionary Lookups 2m
- Looking up Items with TryGetValue() 2m
- Demo: Importing the Countries into a Dictionary 3m
- Summary 1m
- Overview 1m
- Enumerating: for vs. foreach 3m
- Loop Termination Conditions 2m
- Iterating Only Some Items 2m
- Batching an Iteration 3m
- Displaying the Order When Enumerating 2m
- Enumerating Backwards 3m
- Systematically Removing Elements from a List 3m
- Keeping the Index in Sync: The Hidden Gotcha 2m
- foreach Is Readonly 1m
- Removing Elements with Removeall() 2m
- Summary 1m
- Overview 1m
- Partitioning Data with a Dictionary 2m
- Importing the Countries into the Dictionary of List 4m
- Enumerating Dictionary Keys 2m
- Jagged Arrays 2m
- The Noughts and Crosses Demo: Instantiating a Jagged Array 3m
- The Game Logic 1m
- Accessing Jagged Array Elements with Chained Look-ups 4m
- Multidimensional Arrays 3m
- Summary 1m
Course FAQ
C# collections are classes used for storing, retrieving, and managing data. Collections let you group data together and effectively look up, enumerate, query, and modify it as needed.
The three most commonly used collections in C# are arrays, lists, and dictionaries.
This course will give you an introduction to C# collections, including:
- Arrays, lists, and dictionaries
- Importing from a data source
- Resizing collections with lists
- Storing keyed data with dictionaries
- Manipulating list data
- Selecting items using LINQ
- Creating collections of collections
- Much more
Anyone who wants to learn about C# collections should take this course. If you want to learn how to use arrays, lists, and dictionaries in your C# programming, then this is the place to be.
Before beginning this course, you need to be able to write simple apps in C# using Visual Studio. This is a beginners' course so you don't need any prior knowledge of collections, but you do need to know basic C#.