Learn C# Essentials and Frameworks for New Developers

by Kenji Elzerman
Learn C# Essential Concepts and Frameworks for New Developers - Kens Learning Curve

One of the many questions I got when I was a teacher, and one I still see a lot on the internet, is “What do I need to do to become a good C# developer?” There isn’t a simple, quick answer to that. C# is used a lot and it has a steep learning curve. That said, it does depend on how quickly someone learns. Some people have experience with other languages like Java or Python. They are likely to learn C# quicker than someone who has never printed Hello World on their screen. In this article, I show you how to learn C# essentials and give you some hints and tips on where to look.

This article is to give you some idea of where to focus while you are learning C#. It’s not an in-depth tutorial where I am going to explain everything in detail. I will point you to some crucial subjects and frameworks you should investigate and that will help you understand C#.

A Long, Long Time Ago …

… In 2002. This is the year Microsoft launched C#. I was a bit surprised because I thought C# was way older.

The idea behind C# was to combine the power of C++ and the simplicity of Java. Yes, C# is partially based on Java. These two combined made C#, a language to build software applications for Windows.

The .NET framework already existed in 2002 and C# is closely tied to this framework, using the libraries and tools from .NET at its full capacity. The .NET framework also provides a common runtime environment, type safety, garbage collection, and much more.

With C# you can build Windows desktop applications, web applications, and much more. These days, C# isn’t only working on Windows machines, but you can also use it on Linux, macOS, and mobile devices.

What Is C#?

It is a programming language, but I think you already figured that out. But it’s also OOP, which stands for Object-Oriented Programming. And that means that you can use objects. 

Objects are instances of classes, which have properties and methods. You can see them as real-world objects and their interaction with each other. This makes our work as developers a bit easier to understand.

It also helps to create reusable code and make it more modular. Therefore, the code becomes easier to understand and easier to maintain.

With OOP come a few features you should be familiar with encapsulationinheritance, and polymorphism. A short explanation:

Encapsulation refers to the practice of hiding the internal details of an object and exposing only the methods and properties that are necessary for other objects to interact with it. Inheritance allows for the creation of new classes based on existing ones, with the new class inheriting the properties and behaviors of the original class. Polymorphism allows for the same method to be used with different types of objects, which can simplify the code and make it more flexible.

C# can be used for a wide range of projects. Here is a small list:

  • Windows desktop applications
  • Web applications and web services
  • Game development
  • Mobile app development
  • Artificial intelligence and machine learning applications
  • Database programming and development 
  • Internet of Things applications
  • Scientific computing and numerical analysis
  • Financial applications and trading systems
  • Blockchain and cryptocurrency development

So, Where To Start?

There are many places where you can learn C# essentials. You need to find that one place that suits everything you need and want. Everyone learns differently. Some people love to read, while others rather watch a YouTube video.

C# Bootcamp

For those who like to read, I have created a C# Bootcamp. Divided over 24 chapters, I will explain everything you need to know about C#. From the very first Hello World in a console application to a WinForms application. You will explore Entity Framework, caching, events, and much more. It shows you the very basics of C# and is a great place to start.

C# Bootcamp - Learn C# Essentials and Frameworks for New Developers - Kens Learning Curve

https://kenslearningcurve.com/bundles/c-bootcamp-your-one-stop-resource-for-learning-the-language/

But there are many more websites where you can learn C# essentials.

W3Schools

W3Schools - Learn C# Essentials and Frameworks for New Developers - Kens Learning Curve

https://www.w3schools.com/cs/index.php

W3Schools has been around for as long as I know and the content is always good. This is a nice tutorial to start with C#. It’s short, covers a lot, and is easy to follow. Besides being short and easy to follow, they also have an editor where you can try the code and experiment with it a bit.

Microsoft

Micrososft - Learn C# Essentials and Frameworks for New Developers - Kens Learning Curve

https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/tutorials/

The documentation from Microsoft hasn’t always been good. It was actually pretty bad. But in the last few years, they created some good content, better to read, and more up-to-date.

One of the things I love about these tutorials is that they have videos and an interactive tutorial where you can type along. The best way to learn is by doing.

CSharpTutorial.net

CSharpTutoirial - Learn C# Essentials and Frameworks for New Developers - Kens Learning Curve

https://www.csharptutorial.net/

Learn everything from start to end with this online tutorial. It even tells you how to install Visual Studio, it’s pretty up-to-date, and they use good and clear examples.

Although this tutorial has no interactive elements or videos, it does cover all the topics.

Frameworks

As said in the history, C# is specifically built for the .NET framework. It is a really good idea to dive into this framework too.

The .NET Framework, created by Microsoft, is to provide a consistent programming model and command set of APIs for building applications that run on Windows. These days .NET also works on Linux, macOS, and mobile devices.

The framework has a collection of technologies and tools. Here are a few:

  • The common language runtime (CLR)
    This one manages the execution of code written in different programming languages, such as C#, VB.NET, and F#.
  • Libraries with prebuilt code for things like file I/O, network tasks, and user interface (UI) development.
  • Different tools that not only help with developing but also help deploy applications, including Visual Studio, a very popular integrated development environment (IDE).
  • A wide range of application types, including Windows desktop applications, web applications, web services, mobile applications, and games.

There is .NET Framework, which is the traditional .NET, and the .NET Core. The last one is a cross-platform version of .NET that can run on Windows, Linux, and macOS. The latest versions, .NET 5, .NET 6, and .NET 7, are a merge of .NET Core and .NET Framework into a unified platform.

Most C# tutorials also cover the .NET Framework, so I wouldn’t look for .NET-specific tutorials.

Entity Framework

Another framework that should be really on your radar is Entity Framework. It is a framework that can communicate with your database. It is an ORM, which stands for object-relational mapping and enables us to work with domain objects and properties.

You develop your database using code, which makes it a lot easier to build, read, and handle a database for developers. This is ideal when you create a new project that doesn’t have a database. We call this the code-first approach.

But it also works the other way. If you already have a database you can use Entity Framework to import that database and create the C# code for you. This is what we call the database-first approach.

Most of the C# applications use Entity Framework, so it’s a good idea to dive into that. Here are a few tutorials that can help you out:

Entity Framework For Dummies

Entity Framework for dummys Thumbnail

Learn the basics with Entity Framework. This is a good start if you never worked with Entity Framework before.

Entity Framework database-first

Mastering Entity Framework database first in C# - Kens Learning Curve

If you want to use the database-first approach, this tutorial will help you achieve it.

Using SQLite with Entity Framework

Using SQLite with Entity Framework Core in C# - Kens Learning Curve

Not using an SQL server or do you want to know how you can use a different provider? Learn about it here.

Although Entity Framework will take away the use of pure SQL, it might be a good idea to get some knowledge of TSQL.

Architecture

When you learn C# you will notice you create a lot of files and projects. To keep track of these we use architecture. Yes, the same as with buildings. But instead of building something that looks strange from the outside, we use architecture to create a certain readability for our software.

There are a few types of architecture but the most used is the three-tier or n-tier architecture. It creates layers in your application that will show you where certain logic is placed. 

Here are a few tutorials that can help you understand and use the three-tier architecture:

A Guide to 3-Tier Architecture

A Guid to 3-tier Architecture - Kens Learning Curve

Learn the theory behind this architecture. Here I will explain the different layers you can use and how to use them.

Your C# Project with a 3-tier approach

Jumpstart your C# project with a 3-tier architecture - Kens Learning Curve

Let’s put theory into practice in this tutorial. What you learned of the theory is being used in C# in this tutorial

Unit Testing

While coding is fun and all, you need to make sure your code is always working. When something goes wrong customers usually blame the developers, but 7 out of 10 times it’s a wrong input but the customer. 2 out of 10 times it’s a logic problem (“well, didn’t see that one coming”), and 1 out 10 times it’s a developers error.

We, developers, cannot think for a customer or all the things a user can do. But we can make sure our code works as it should. Therefore, we should test our code. Not the application, but the logic that makes the application work. This is what we call ‘unit testing’.

A few benefits of this kind of testing:

  1. We can submit proof the method works as it should and the front-end team should make a validation on something.
  2. When we change code in another class and it breaks the functionality of a different class, we find it by testing both classes.
  3. If set up right, code can not be released as long as some unit tests are not working.

The technique behind unit testing isn’t hard to understand, but the logic can get a bit complex. Therefore, it’s important to learn how to unit test as soon as you understand the basics of C#.

Unit Testing with C# for beginners

Unit Testing with C# - Kens Learning Curve

If you never used unit testing with C#, this is the tutorial to start with. It shows you the basics of XUnit.

Testing Exceptions with xUnit

Testing Exceptions with xUnit - Kens Learning Curve

A bit more in-depth about unit testing. Exceptions are a bit different when it comes to unit testing.

Unit Testing And Mocking

Unit Testing and Mocking - Kens Learning Curve

Mocking is a technique you can’t miss when you learn about unit testing. It will help you out more than you might think.

Dependency Injection

Developers love patterns and design patterns are very loved. One of the design patterns is called Dependency Injection. I recommend looking into this one when want to learn C# essentials and maybe a bit more than that.

Dependency Injection is a design pattern commonly used in object-oriented programming that helps to manage dependencies between objects in a system. In simple terms, it is a way of passing objects (or dependencies) to a class from outside, instead of having the class create them internally.

In Dependency Injection, the responsibility for creating and managing objects is shifted from the class itself to a separate component known as a “dependency injection container”. This container is responsible for creating and managing objects and injecting them into the class that needs them. This allows for more modular and flexible code since it separates the creation of objects from the logic of the application.

We don’t use it because we can, but we use it because it has some serious benefits:

  • Improved code maintainability and testability
  • Reduced coupling between objects, making it easier to change and update the code
  • Easier management of object lifetimes and resources
  • Better scalability, as the system can be more easily adapted to changes in requirements or scale

Dependency injection is not only used in C#, so be careful when you look up information. Be sure to add “c#” in your search query, otherwise, you might be looking at code you don’t understand.

Azure DevOps / GIT / Azure Cloud

Another thing you might want to dive in, but is not really needed when you just begin, is Azure. Mostly known for its Cloud services, but it also has a DevOps service. This isn’t required when you learn C# essentials, but it could be worth looking into it.

Azure Cloud and DevOps are usually spoken out as if they are the same thing. But DevOps has everything you need for your workflow… And it’s free! A few things DevOps has:

  • Agile working
    You can use a (scrum)board, work in sprints, and keep track of what you are doing
  • Pipeline
    Use the pipelines to create your CI/CD (continuous integration and deployment)
  • Repos
    Store your code in GIT repositories so you can share it with team members or keep an online copy of your work.
  • Artifacts
    Create your own packages, such as NuGet, NPM, etc, to share with team members or other people.
  • Wiki
    Create your own Wiki per project so you can have documentation or notes.

Microsoft has some pretty good tutorials about Azure DevOps. But if you want to learn more about GIT you might want to check out the tutorial W3Schools.

Azure Cloud, or any other Cloud, is a bit different. To keep it short: The cloud helps you host and manage applications on a global scale. It offers a lot of services. Here are a few:

  • Virtual Machines
  • App Service
  • Storage
  • Functions
  • Cognitive Services
  • Automation Services
  • And much more

Although it isn’t free, you get credits when you sign up. You can use these credits for a limited period.

Cloud services aren’t things you MUST learn, but it’s a good idea to know what they are and what you can do with them.

To Learn Is To Do

If you are like me and can’t really learn from (digital) books, the best thing you can do is learn by doing it. When you have covered the basics, which you really should do before creating something, you should think of something simple you want to create with C#. A calculator, a game like Hangman, or an online portfolio. 

Then you need to start learning how to start and from there you will reach certain problems. Fix those problems by looking them up and implementing the solution in your application. Some solutions aren’t the best, but when it works it works. You will learn to make it better some other time.

During your search for solutions, you will encounter terms you don’t know. Look them up and learn what they are. Don’t look for answers and just accept them; learn why you should accept them.

Don’t know what you should do? I can help you. Send me a message or a comment below.

Conclusion Learn C# Essentials

These are the parts I would check out if you are just starting to learn coding in C#. Keep in mind you can’t be an expert C# developer within a month, it will take time. You will make mistakes and be angry at your computer, but it’s all part of the learning process. This is not only with C# but with all the development languages you might learn. But these are my tips when you want to learn C# essentials.

The best thing is to try, start somewhere, and build up from there. Whether you are learning C#, PHP, Python, Java, or C++, the process is the same, but the language is different.

2 comments

chris February 25, 2023 - 2:10 pm

Can you recommend resources/articles to learn Asp.net Webapi? + EF + ASP.NET Identity + Bearer Tokenem ? . I am noob angular developer. I am fixing bugs (on back-end ( asp.net (2.2)) and front-end) and I plan to have better knowlege about Web.Api.

Reply
Kens Learning Curve February 26, 2023 - 12:11 am

Hi Chris!

For Entity Framework, you can use the tutorials listed in this article. There is a good ASP.NET tutorial on Microsoft Learning, which gives you enough information. From basic to more advanced. A tutorial with identity, which includes the bearer token (also known as the JWT) can be found here.

I do have a tutorial on Web API with .NET 6, but it’s for the minimal API and some basic information is required. The link to Microsoft Learning shows you the basic of the web APIs and after that, you can choose to follow the tutorial about the minimal API.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

Table Of Contents
Kens Learning Curve