Attributes are classes that contain data just like normal classes, but the purpose of this data is different. Attributes contain metadata that describes targets. Targets can be of different types such as classes, interfaces, method, events, and so on.
Attributes can either be intrinsic or custom . Intrinsic attributes are part of the CLR (Common Language Runtime) and are contained in the .NET framework. Custom attributes are attributes that you can create yourself.
Because attributes contains metadata, they are only useful when reflection is used. An example of this is a
DataContract attribute. The service generation process uses reflection on the classes that the service class uses to determine which of these classes are data contracts.
The following code shows the usage...