What are generic attributes in C# 11? Generic attributes increase the flexibility of a very early .NET feature. Let's try using them and see how it keeps our code DRY.
What are attributes in C#, and why do we need them? Ever thought it'd be convenient to attach metadata to your code at design time, then read it at runtime? Attributes let you do just that - to methods, classes, tests, enumerations, and more. Use reflection to read them at runtime and take some action. Here's a few examples for the uninitiated...
The effect of the Obsolete attribute on a class is ignored when there's an interface involved The effect of the Obsolete attribute on a class is ignored when there's an interface involved. It caught me by surprise, but on second thought makes complete sense!