
Explore primary constructors in C# 12, adding parameters to class or struct declarations for internal use, with a record-like syntax, and guidelines that parameters are not properties unless exposed.
Explore primary constructors in C# 12 by creating a customer class with parameters in parentheses, and show how to initialize data and expose public properties.
Demonstrates dependency injection with a translation service via a primary constructor, using a service collection to register a Google translation as a singleton.
Explore how primary constructors in C# 12 affect parameterless constructors, compare class vs struct behavior, and learn to initialize base constructors using this to enable parameterless instantiation.
Apply primary constructors to simplify the book class and related models. Inject iBook service via constructors in the Books Controller and verify endpoints with Swagger.
Explore the motivation behind C# 12 collection expressions, comparing array, list, span, stackalloc, and immutable array initializations, and learn how this feature simplifies and streamlines collection creation across languages.
Discover how collection expressions simplify code by using brackets for arrays, lists, sets, and mutable arrays, while enforcing explicit data types and passing values to methods with enumerable inputs.
Explore the spread element in C# 12, using a pair of dots to merge lists within a single collection expression and create cleaner, combined collections.
Explore collection builder in C# 12 by implementing a custom type that supports collection expressions through a static create method and a collection builder attribute, enabling seamless initialization.
Practice implementing collection expressions in a hands-on project with a task repository and time calculator. Learn to add, remove, filter by category, concatenate tasks, and compute total durations.
Demonstrates refactoring the todo item with a primary constructor and builds tasks with collection expressions, including the spread operator, to simplify repository code and total time calculations.
Discover how C# 12 lambda expressions can use a params array to pass multiple integers, and learn how collection expressions affect delegate compatibility across versions.
Demonstrate problem resolution in a practical C# 12 exercise by using a default model parameter and a params array of IDs to generate image URLs with a lambda.
Explore the alias any type feature in C# 12, enabling aliases for namespaces, specific types, delegates, and tuples to simplify code.
Explore aliasing in C# 12 by defining using aliases and global namespaces from Program.cs to simplify cross-module code, practicing with Person and Processor classes across modules.
Learn to simplify complex C# 12 code by using primary constructors, global using aliases, and type aliases to streamline namespaces, tuples, and data types across modules, improving readability.
Hello My name is Hector Perez, Be welcome to the course, "New features in C# 12, a practical guide". I am Microsoft MVP and software developer with more than 10 years of experience
C# is the powerful programming language created by Microsoft, placed among the most popular and used today
The reason, is that with C# you can create almost any type of application, from video games, to mobile applications, to web projects
With the release of a new version of .NET every year, new features are added to C#, making it an increasingly flexible and powerful language
In this course, you will learn about the main features of C# 12, the reason behind the incorporation of each of them into the language, as well as exercises that will allow you to get hands-on to practice what you have learned
At the end of the course, you will know what are the main new features of C# 12 and how to use them in your projects
Some of the topics that we will see in the course are:
Primary Constructors
Collection Expressions
Optional parameters for lambdas
Param array parameters for lambdas
Alias any type
Among other topics
To have a good use of the course, it is recommended to have basic knowledge of C#
What are you waiting for to update your C# knowledge? See you in the course