You can add declarative information to a program by using an attribute.
An attribute defines additional information that is associated with a class, structure, method, and so on.
- An attribute is supported by a class that inherits System.Attribute.
- All attribute classes must be subclasses of System.Attribute.
- This built-in attribute AttributeUsage specifies the types of items to which the attribute can be applied.
public void Validate()
C# defines three built-in attributes: