Skip to content
Learn at your own pace

Learn C#

Learn C# and .NET from types and LINQ to async code, dependency injection, testing and production-ready services.

A student connects colorful building blocks beside a laptop, illustrating a sequence of programming instructions.
One small step becomes a working program.
24lessons in 6 stages
48practice exercises
24project milestones
96quiz questions
96review cards

A clear place to start

C# is a typed language on the .NET platform. It supports command-line tools, background services, and the application logic used by ASP.NET web applications.

What you need first

Know basic variables, loops, and functions. Install the .NET SDK, which supplies the build and run tools. Read the starter program before exploring project configuration.

Start with these ideas

  1. A type describes a value: int score = 10. A nullable value can represent absence, which differs from a valid zero.
  2. A class groups behavior and data. A record is useful when comparing values by their contents.
  3. A Task represents eventual completion. Await asynchronous operations rather than blocking while they wait.

Connect it to a real project

Build a habit-report tool, then add typed records, file input, asynchronous work, tests, and a hosted background processor.

Study one concept at a time. Explain its everyday example in your own words, predict the worked example’s result, then try a small change. Use practice and quiz feedback to decide what to revisit. You can spread a lesson across several study sessions.

Set up your environment Tools, setup steps, and completion requirements

Start with the ideas above, then set up the tools below. Return to the starter example whenever a new term feels unfamiliar.

text
dotnet --version
dotnet new console -n Lesson
cd Lesson
dotnet run
# Tests: dotnet new xunit -n Lesson.Tests, add a project reference, then run dotnet test
# Use a current LTS .NET SDK. Keep <Nullable>enable</Nullable> and add <TreatWarningsAsErrors>true</TreatWarningsAsErrors>.

A free account saves your progress, notes, exercise evidence and spaced review cards. To complete a lesson, score at least 80% on its quiz, finish both exercises and the project checklist, and submit your project link with a reflection. Project evidence is self-reported; use the final portfolio rubrics to seek an independent code review.

Your C# learning path

Work through these foundations in order, then bring them together in a project.

24 of 24 lessons · follow the stages in order

Start with a small example

In a project created with dotnet new console, put this in Program.cs and run dotnet run. The loop prints a learning goal for each topic with string interpolation.

var topics = new[] { "records", "LINQ", "async" };

foreach (var topic in topics)
{
    Console.WriteLine($"Learn {topic}");
}

Try it yourself

Use LINQ to keep only the topics longer than four characters and print how many remain.

Put it into practice

Build an expense tracker

Create a console app that records and summarizes expenses.

  1. Model an expense as a record with a date, category and decimal amount.
  2. Load and save expenses as JSON and validate every field.
  3. Summarize totals by category and month with LINQ.
  4. Write xUnit tests for parsing, validation and the summaries.
Keep exploring

Find your next course

Choose a language, build on it with a framework, or explore AI and search.

Showing 6 of 17 courses