Modern C# and .NET
There’s been a huge number of additions to C# and .NET over the past decade. Some of these improvements let us build more robust, scalable, and efficient applications. It can be rather difficult to know exactly how to best apply these new language features, .NET libraries, and how to use the new tools available.
Throughout this workshop you will be exploring how to write modern C# and .NET applications, by applying these new additions.
You will learn:
- How to write more memory efficient code
- Asynchronous programming, including best practices, asynchronous streams and how to best use the newest additions to these principles
- Mastering language features such as pattern matching, record types and understanding how to write modern C# code to avoid null reference exceptions
- How to use System.Text.Json
You will explore the changes in .NET, and C# through ASP.NET Core. This means we are also going to look at the modernisation of building applications through using a tool such as .NET Aspire.
This workshop is packed with details on how to become a modern .NET and C# developer. No matter if the end goal is to build web, desktop or mobile applications this is a workshop you certainly don’t want to miss!'
Agenda overview:
- Setting up and familiarise yourself with the exercise application: ASP.NET Core, Blazor and .NET Aspire
- Understanding records and nullable reference types
- Using System.Text.Json to process data sent to and from the application. Explore how to handle inheritance, null values, required parameters and constructor parameters
- Getting comfortable with collection expressions. How do they work? How do you combine multiple lists?
- Use pattern matching to process objects and make decisions. Learn about the different patterns such as relational, list, and/or. Write code that is easier to understand, maintain and discuss using pattern matching
- Memory efficiency using spans and memory. Refactor your code to use these principles to avoid unnecessary allocations, and faster processing of data. Benchmark and profile the code to measure how much faster, or slower the code is
- Params and overload resolution priority: A great addition for library developers
- Further explore spans to using the new extensions introduced. Such as StartsWith, EndsWith, Split
- Understanding Tasks
- Using async and await
- Streaming using asynchronous streams
What to bring:
- Laptop with .NET 9.0 installed
- Visual Studio Code, Visual Studio, Rider or any other IDE of your choice that let you debug .NET applications
Filip is the author of C# Smorgasbord and over 20 Pluralsight courses, speaker at events and user groups around the globe, Microsoft MVP for 11 years in a row. He loves teaching fellow developers how to master all things C# and .NET.