In this C# Crash Course, we'll go over the basics of C# so that you'll be ready to build out exciting web apps! We'll start by going through the key attributes of C#, syntax basics, and introduce you to OOP. In each section, we'll link you to some quick in-browser C# challenges so you can apply these concepts.
If you're completely new to C# and want a more comprehensive learning path, check out our [C# Curriculum](https://aka.ms/selfguidedcsharp). The projects included in that curriculum are listed below. You can open this repository as a Codespace to complete those projects.
| 01 | [Write your first code using C#](https://learn.microsoft.com/training/paths/get-started-c-sharp-part-1/) | [Calculate and print student grades](https://learn.microsoft.com/en-us/training/modules/guided-project-calculate-print-student-grades/) | [Calculate final GPA](https://learn.microsoft.com/en-us/training/modules/guided-project-calculate-final-gpa/)
| 02 | [Create and run simple C# console applications](https://learn.microsoft.com/training/paths/get-started-c-sharp-part-2/) | [Develop foreach and if-elseif-else structures to process array data in C#](https://learn.microsoft.com/training/modules/guided-project-arrays-iteration-selection/), [Code](1-projects/guided-project) | [Develop foreach and if-elseif-else structures to process array data in C#](https://learn.microsoft.com/training/modules/challenge-project-arrays-iteration-selection/), [Code](1-projects/challenge-project)
| 03 | [Add logic to C# console applications](https://learn.microsoft.com/training/paths/get-started-c-sharp-part-3/) | [Develop conditional branching and looping structures in C#](https://learn.microsoft.com/training/modules/guided-project-develop-conditional-branching-looping/), [Code](2-projects/projects) | [Develop branching and looping structures in C#](https://learn.microsoft.com/training/modules/challenge-project-develop-branching-looping-structures-c-sharp/), [Code]()
| 04 | [Work with variable data in C# console applications](https://learn.microsoft.com/training/paths/get-started-c-sharp-part-4/) | [Work with variable data in C#](https://learn.microsoft.com/training/modules/guided-project-work-variable-data-c-sharp/), [Code]() | [Challenge - Work with variable data in C#](https://learn.microsoft.com/training/modules/challenge-project-work-variable-data-c-sharp/), [Code]()
| 05 | [Create methods in C# console applications](https://learn.microsoft.com/training/paths/get-started-c-sharp-part-5/) | [Plan a petting zoo visit](https://learn.microsoft.com/training/modules/guided-project-visit-petting-zoo/), [Code]() | [Create a mini-game](https://learn.microsoft.com/training/modules/challenge-project-create-mini-game/), [Code]()
| 06 | [Debug C# console applications](https://learn.microsoft.com/training/paths/get-started-c-sharp-part-6/) | [Debug and handle exceptions in a C# console application using Visual Studio Code](https://learn.microsoft.com/training/modules/guided-project-debug-handle-exceptions-c-sharp-console-application/), [Code]() | [Challenge - Debug a C# console application](https://learn.microsoft.com/training/modules/challenge-project-debug-c-sharp-console-application/), [Code]()
A **compiler** converts the code you write into a format that your computer can understand. After you write C# and build it, the C# compiler (called Roslyn) will analyze your code to check for any errors.
The `. (DOT)` in `Console.WriteLine` allows us to access methods and properties. In this example, `Console` is a type that represents the console window. `WriteLine` is a method of the Console type that prints a line of text to that text console.
In C#, you can build applications that employ decision-making logic so that your application performs different instructions based on a set of conditions. One way we do this is with an `if` statement. `if` statements are made up of three parts:
If there are multiple condition, you can utilize the `else if` and `else` statements. Basically, if the `if` statement fails, these other statements allow you to test against other conditions.
Objects are defined by **Classes**. In other words, an **Object** is an instance of a class.
One way to think about this is that a class is like the blue prints for a house. The actual house that is built is an objects because it is an instance of this blue print.
Objects inherently have attributes. In C# we call these **properties**. The attributes of a house may be the number of doors, what color the house is painted, etc.
We can also define **methods** which describe what an object can do. For example, you can sell your house.
C# also has built in classes and functionality within the .NET Class Library. The .NET Class Library is a collection of thousands of classes containing tens of thousands of methods. These methods are created by Microsoft and are available for use in your applications. For example, when we called `Console.WriteLine` earlier, we were calling a method from the `System.Console` class. For a more in-depth overview, you can read up on the .NET Class Library in the [.NET documentation](https://docs.microsoft.com/dotnet/standard/class-library-overview).
* C# Video Series on [Microsoft Docs](https://docs.microsoft.com/shows/CSharp-101/?WT.mc_id=dotnet-35129-website) or [YouTube](https://www.youtube.com/watch?v=Z5JS36NlJiU)
* Self Guided Tutorials on [Microsoft Learn](https://docs.microsoft.com/users/dotnet/collections/yz26f8y64n7k07)
* [Learn to Code Page](https://dotnet.microsoft.com/learntocode)
Connect with us! Check out the [.NET Community Page](https://dotnet.microsoft.com/platform/community) to find links to our blogs, YouTube, Twitter, and more.