Attributes are elements of metadata that you can attach to entities such as assemblies, classes, methods, properties, et al. The .NET Framework makes use of many attributes that allow you to affect the behavior of the compiler or how the Framework uses an entity. For example, you can assign attributes to properties of a control object that allow a friendly name and description to be shown in the property browser in Visual Studio.
At some point, you'll come into a situation where you'll want to use a custom attribute. Defining and using attributes are very easy and in this article I will provide a very simple setup using a few attributes defined at the class level. Defining and using attributes at other levels vary only slightly and I'll make note when there is a difference.
Read the rest of the article