Generic Attributes in C#11 | .NET7 New Features | C#11 New Features |
Автор: PRO Concepts
Загружено: 2024-10-06
Просмотров: 183
Описание:
In today’s video, we’re diving into one of the exciting new features in C# 11—Generic Attributes. This new capability allows developers to define attributes using generics, which can make your code cleaner and more reusable.
When generics were introduced in C# 2.0, attribute classes were not allowed to participate.We can make the language more composable by removing (rather, loosening) this restriction. The .NET Core runtime has added support for generic attributes. Now, all that's missing is support for generic attributes in the compiler.
Currently attribute authors can take a System.Type as a parameter and have users pass a typeof expression to provide the attribute with types that it needs. However, outside of analyzers, there's no way for an attribute author to constrain what types are allowed to be passed to an attribute via typeof. If attributes could be generic, then attribute authors could use the existing system of type parameter constraints to express the requirements for the types they take as input.
What's New in .NET7 & C#11 Playlist Link:
• What's New in .NET7 & C#11
AspNetCoreMVC Playlist Link:
• ASP NET CORE TUTORIAL | ASP.NET CORE | Wit...
#PROConcepts #AmitRawat #ProgrammingConcepts #PROConceptsByAmit #ProgrammingConceptsByAmit #ProgrammingConceptsByAmitSinghRawat #ProConceptsByAmitSinghRawat
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: