Paths

C#

Authors: Scott Allen, Eric Fisher, Simon Robinson, Deborah Kurata, Filip Ekberg, Jason Roberts, Jeremy Clark, Elton Stoneman, Dan Wahlin

C# is the most commonly used language for leveraging the .NET Framework. As such, learning C# is a springboard to creating enterprise systems, desktop applications, websites and... Read more

What you will learn

  • C# syntax
  • Object oriented paradigm
  • Arrays, lists, dictionaries
  • Interfaces
  • Generics
  • Events, delegates, and lambdas
  • LINQ
  • Asynchronous programming

Pre-requisites

No prior C# knowledge or experience is needed. Some understanding of common programming concepts, such as variables and looping, will be helpful.

Beginner

Do you want to become productive with C#? This beginner area is the perfect place to start. These C# tutorials are designed to give you everything you need to become a productive C# developer. By the end of this section, you’ll have a firm understanding of the C# language and valuable insights on how things work under the hood.

C# Fundamentals

by Scott Allen

Apr 16, 2019 / 6h 5m

6h 5m

Start Course
Description

C# has consistently been one of the top three programming languages to learn as it's used widely throughout the industry. This course, C# Fundamentals, will help you be comfortable with fundamental programming concepts on any platform. First, you will learn about the syntax of the C# language. Next, you will discover the built-in features of .NET. Finally, you will explore how to solve problems using object-oriented programming techniques. When you are finished with this course, you will have the skills and knowledge you need for real-world solutions.

Table of contents
  1. Course Overview
  2. Introducing C# and .NET
  3. Learning the C# Syntax
  4. Working with Classes and Objects
  5. Testing Your Code
  6. Working with Reference Types and Value Types
  7. Controlling the Flow of Execution
  8. Building Types
  9. Object-oriented Programming with C#
  10. Catching up with the Latest in C#
  11. Going Further with C#
Interactive

C#: Using Variables and Conditionals

by Eric Fisher

May 30, 2018 / 32m

32m

Start Course
Description

Learn the basics of C# to create and run your first C# console application, which will accept user input and provide varying feedback based on that input. This interactive course was formerly known as Try C# on Code School.

Table of contents
  1. Introduction1 Video - 1 Challenge
  2. Variables1 Video - 1 Challenge
  3. Conditions1 Video - 2 Challenges
Interactive

C#: Using Classes, Methods, Objects, and Loops

by Eric Fisher

May 30, 2018 / 1h 7m

1h 7m

Start Course
Description

Learn to work with classes, methods, groups of objects, loops, and method overloads to create a C# console application for tracking bands. This interactive course was formerly known as Keeping It Classy With C# on Code School.

Table of contents
  1. Methods1 Video - 2 Challenges
  2. Classes1 Video - 3 Challenges
  3. Groups of Objects1 Video - 2 Challenges
  4. Loops1 Video - 1 Challenge
  5. Method Overloads1 Video - 1 Challenge

Beginning C# Collections

by Simon Robinson

Mar 29, 2019 / 3h 26m

3h 26m

Start Course
Description

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 array, the list, and the dictionary - the three most widely used collections - to group data together. Next, you will discover how to query data using the foreach and for loops and also using LINQ. 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
  1. Course Overview
  2. Introducing Collections and Arrays
  3. Importing from a Data Source into an Array
  4. Resizing Collections with Lists
  5. Storing Keyed Data with Dictionaries
  6. Manipulating List Data
  7. Selecting Items Using LINQ
  8. Creating Collections of Collections
  9. Taking Collections Further

Object-Oriented Programming Fundamentals in C#

by Deborah Kurata

Mar 11, 2019 / 3h 27m

3h 27m

Start Course
Description

This course takes you through the principles and practices of object-oriented programming (OOP). The course provides you with the firm foundation in OOP that you need to progress to intermediate-level C# courses. It begins by showing you how to turn a set of words into a set of well-defined and related classes. Through demonstrations, it teaches you key object-oriented concepts such as abstraction, encapsulation, inheritance, polymorphism, and interfaces.

Table of contents
  1. Course Overview
  2. Introduction
  3. Identifying Classes from Requirements
  4. Building Entity Classes
  5. Building Entity Classes - Methods
  6. Separation of Responsibilities
  7. Establishing Relationships
  8. Leveraging Reuse through Inheritance
  9. Building Reusable Components
  10. Understanding Interfaces
  11. Final Words and Next Steps
Project

Add Features to Grade Book Application Using C#

by Eric Fisher

Jan 15, 2018 / 2h 5m

2h 5m

Start Project
Description

In this project you will use the C# programming language to add new features to an existing grade book application.

Project overview
  1. Setup15m
  2. Creating New GradeBookTypes15m
  3. Override RankedGradeBook's GetLetterGrade30m
  4. Override Statistics10m
  5. Add GradeBookType Support to StartingUserInterface20m
  6. Make BaseGradeBook Abstract5m
  7. Add Support for Weighted Grading30m

Intermediate

Once you have a strong foundation with C#, you can now start fine tuning your skills to create code that is more maintainable, extensible, and object-oriented. The C# courses in this section will provide everything you need to know to take advantage of the rich feature set C# provides.

Interactive

C#: Using LINQ Queries & Operators

by Eric Fisher

Feb 27, 2019 / 15m

15m

Start Course
Description

This course introduces the basics of LINQ and its most common operators. You'll learn to use Select, Where, OrderBy, and GroupBy to structure, filter, and organize data in C# using LINQ.

Table of contents
  1. Using LINQ Queries & Operators1 Video - 3 Challenges

LINQ Fundamentals

by Scott Allen

Jul 28, 2016 / 4h 23m

4h 23m

Start Course
Description

LINQ introduced radical changes to the C# language. In this course, LINQ Fundamentals you'll see features of the C# language that make LINQ work, as well as how to use LINQ effectively using practical examples. You'll start with seeing a demonstration of the power of LINQ along with some of the important features of the C# language for LINQ, including how to create and use extension methods and lambda expressions. Next, you'll focus on the behavior of LINQ queries and start to work with realistic data to learn how to filter, order, and project data. Finally, you'll see some demonstrations on how to use LINQ to XML as well as, how LINQ works with a remote datasource by using the Entity Framework against Microsoft SQL Server. By the end of this course, you'll be ready to process and query in-memory data, as well as work with XML and a SQL Server database.

Table of contents
  1. Course Overview
  2. An Introduction
  3. LINQ and C#
  4. LINQ Queries
  5. Filter, Ordering & Projecting
  6. Joining, Grouping & Aggregating
  7. LINQ to XML
  8. LINQ and the Entity Framework

Dates and Times in .NET

by Filip Ekberg

Jul 16, 2019 / 1h 22m

1h 22m

Start Course
Description

Ever had issues caused by date and times with .NET within your applications? In this course, Dates and Times in .NET, you will master the art of parsing dates and times and how to handle ambiguity using common standards that usually get overlooked and cause unexpected errors. First, you will learn how to handle relative time and time periods, such as calculating the time difference between two periods. Next, you will discover how time zones impact applications, how to properly handle them, and what to consider when parsing dates which don’t include time zone information. Finally, you will explore best practices, and how to avoid problems when working with common date and time scenarios in .NET. When you are finished with this course, you will have the skills and knowledge to set up your own applications and parse complex date and time situations whether you’re on Windows, Mac, or Linux!

Table of contents
  1. Course Overview
  2. Date and Time Fundamentals
  3. Date and Time Arithmetic
  4. Solutions to Common Data/Time Scenarios in .NET

Working with Nulls in C#

by Jason Roberts

Aug 19, 2019 / 2h 9m

2h 9m

Start Course
Description

Unexpected null values and NullReferenceExceptions can be a constant source of bugs resulting in wasted time and out of hours support callouts. In this course, Working with Nulls in C#, you'll going to learn about the different ways that null values pop up in C# code and how to deal with them. First, you'll learn the fundamentals of why you get null values and the difference between value and reference types. Next you'll explore how you can use the various C# operators to check for and manipulate nulls. You'll then learn how to think about nulls at a higher abstraction level in your object-oriented code. Finally you'll see how the features introduced in C# 8 can help even more by allowed non-nullable reference types. By the end of this course, you'll understand the different types of objects in C#, how to correctly create nullable value types, how to use C# operators to work with nulls in fewer lines of code, how to implement the Null Object pattern, and how to use nulls in C# 8.

Table of contents
  1. Course Overview
  2. Working with Nullable Value Types and Strings
  3. Accessing and Checking for Null Values
  4. Eliminating Null Reference Exceptions
  5. Understanding Non-nullable Reference Types in C# 8

Error Handling in C# with Exceptions

by Jason Roberts

Aug 6, 2018 / 1h 37m

1h 37m

Start Course
Description

At the core of handling errors in C# code is a thorough knowledge of exception handling. In this course, Error Handling in C# with Exceptions, you’ll learn how to write code that can detect and respond to runtime errors. First, you’ll learn why exceptions are used to represent errors in C# and how they are organized into class hierarchies. Next, you’ll explore how to throw, catch, filter, rethrow, and wrap exceptions. Finally, you’ll discover how to define, throw, and catch your own customized exception classes and also write unit tests for exception throwing code. When you’re finished with this course, you’ll have a thorough knowledge of C# exceptions that will help you to create production-ready C# applications that detect and respond to runtime errors.

Table of contents
  1. Course Overview
  2. Understanding the Importance of Error Handling
  3. Understanding the Exception Class Hierarchy
  4. Getting Started with Exceptions
  5. Catching, Throwing, and Rethrowing Exceptions
  6. Creating and Using Custom Exceptions
  7. Writing Automated Tests for Exception Throwing Code

Getting Started with Asynchronous Programming in .NET

by Filip Ekberg

Mar 15, 2019 / 2h 22m

2h 22m

Start Course
Description

Utilizing asynchronous principles is crucial for building fast and responsive applications. In this course, Getting Started with Asynchronous Programming in .NET, you’ll learn foundational knowledge to efficiently apply the asynchronous principles to build fast and solid applications. First, you’ll explore how the async and await keywords fit into your .NET applications, and how it ties together with the task parallel library. Next, you’ll discover how asynchronous programming is different from parallel programming and how to use the parallel extensions to perform fast computations, which utilizes all your available processing power. Finally, you’ll learn how to adapt in advanced scenarios, and where deeper knowledge of the internals may be required. When you’re finished with this course, you’ll have the skills and knowledge of how to apply the asynchronous programming principles in any type of .NET application.

Table of contents
  1. Course Overview
  2. Asynchronous Programming in .NET Using Async and Await
  3. Using the Task Parallel Library in .NET
  4. Parallel Programming Using the Parallel Extensions
  5. Asynchronous Programming Deep Dive

Advanced

The courses in this section will provide valuable insight into the finer points of the C# language. This includes a deep dive into creating code with interfaces, the use of extension methods and lambda functions. Finally you will wrap up by gaining an understanding of C# concurrent collections and various tips to be an effective C# developer.

C# Interfaces

by Jeremy Clark

Dec 19, 2018 / 2h 23m

2h 23m

Start Course
Description

Code that is easy to maintain, extend, and test is key to applications that move quickly to meet our users’ changing needs. In this course, C# Interfaces, you will learn how to use interfaces effectively to create flexible and maintainable applications. First, you will see the mechanics of exactly what interfaces are, and why we want to use them. Next, you will explore how to create your own interfaces to make it easy to change them or swap out functionality. Finally, you will delve into designing effective interfaces to make sure that you are getting the benefits that you need in your specific applications. When you are finished with this course, you will have a good understanding of interfaces and how you can use them effectively in your own applications.

Table of contents
  1. Course Overview
  2. Introducing Interfaces
  3. Creating Interfaces to Add Extensibility
  4. Interfaces and Dynamic Loading
  5. Explicit Interface Implementation
  6. Designing Effective Interfaces
  7. Interfaces in Frameworks and Patterns

C# Extension Methods

by Elton Stoneman

Oct 1, 2019 / 1h 27m

1h 27m

Start Course
Description

Extension methods are a key feature of C# - they boost productivity, increase the readability of your code, and make it easy to implement standards across your projects. In this course, C# Extension Methods, you will learn all you need to know about extension methods in .NET Framework and .NET Core. First, you will learn the basics of extension methods: how to use them, how to write them, and how the tooling in Visual Studio and VS Code helps you to work with them. Then, you will discover the danger areas and the best practices for building your own extension methods. Finally, you will explore how to package and publish your own extension method library. By the end of this course, you will have a complete understanding of how to get value from this powerful feature.

Table of contents
  1. Course Overview
  2. Getting Started with Extension Methods
  3. Best Practices for Using Extension Methods
  4. Building Your Own Extension Method Library

C# Events, Delegates and Lambdas

by Dan Wahlin

Apr 26, 2013 / 3h 12m

3h 12m

Start Course
Description

Events, delegates and lambdas play an important role in the .NET framework but can be difficult to understand as developers first get started with the C# language. If you’re interested in gaining a more thorough understanding of how these C# technologies work then you’re in the right place! This course focuses solely on events, delegates and lambdas and provides insight into how they can be used in your .NET applications using the C# language.

Table of contents
  1. The Role of Events, Delegates and Event Handlers
  2. Creating Delegates, Events and EventArgs
  3. Handling Events
  4. Lambdas, Action<T> and Func<T,TResult>
  5. Events and Delegates in Action

C# Concurrent Collections

by Simon Robinson

May 15, 2015 / 3h 32m

3h 32m

Start Course
Description

Learn how to use concurrent collections in multithreaded code! This course is a comprehensive introduction to the concurrent collections. It shows you how to use each of the main collection types: ConcurrentDictionary, ConcurrentQueue, ConcurrentBag, and ConcurrentStack. You'll learn the correct techniques for using these collections to avoid bugs such as race conditions, and also how to use BlockingCollection with the concurrent collections correctly in producer-consumer scenarios. The course rounds off with a look at some concurrent collection best practices.

Table of contents
  1. Introducing the Concurrent Collections
  2. Introducing ConcurrentDictionary
  3. Concurrent Dictionary Demo
  4. The Producer-Consumer Collections: Queues, Stacks and Bags
  5. Producer-consumer and BlockingCollection Demo
  6. Some Concurrent Collections Best Practices

C# Tips and Traps

by Jason Roberts

Aug 20, 2013 / 3h 58m

3h 58m

Start Course
Description

Whether you're still learning C# or you already have some experience, it's sometimes hard to know what you don't know. This course is designed to short-circuit your C# learning and provides a whole host of useful information about the sometimes under-used or unknown features of both the C# language and the .Net framework. It's suitable for those who are brand new to C# as well as experienced developers looking to "round off" their C# skills and "fill in the gaps".

Table of contents
  1. Part I
  2. Part II
  3. Part III
  4. Part IV
  5. Part V
  6. Part VI

C# Tips and Traps 2

by Jason Roberts

Sep 18, 2013 / 2h 43m

2h 43m

Start Course
Description

Whether you're still learning C# or you already have some experience, it's sometimes hard to know what you don't know. This is the follow-up course to C# Tips and Traps and is designed to further short-circuit your C# learning and provides a whole host of useful information about the sometimes under-used or unknown features of both the C# language and the .Net framework. It's suitable for those who are brand new to C# as well as experienced developers looking to "round off" their C# skills and "fill in the gaps".

Table of contents
  1. Part I
  2. Part II
  3. Part III
  4. Part IV