What’s New in C# 10.0?

What’s New in C# 10.0?

Dot net 6.0 was released at the end of the year 2021 with new C# 10.0. It introduced many new features, here we will cover a few of them which can be useful in routine coding practice.

So let's start with,

  • Global usings

You can now avoid common repeated using statements on every file. Instead, you can use Keyword Global before any using statement, and that will be available throughout the project, and no need to add on every single page. For ease of use, it's recommended that we create a single .cs file and you can give it any name and keep all the global using statements there and that’s it.

No alt text provided for this image

  • Deconstruction variables

In Deconstruction, now we can mix already declared variables and new declarations as well

No alt text provided for this image

  • Pattern for Extended Property

While Querying, we can now easily access nested properties of any object. It helps to keep code clean, especially when writing complex conditions.

No alt text provided for this image

By : Mehul Gohel

Qeleo Technolabs

要查看或添加评论,请登录

Qeleo Technolabs的更多文章

社区洞察

其他会员也浏览了