2
Reply

what are attributes in .NET ?

    An attribute is a declarative tag that  is used to convey information to runtime about the behaviour of programmatic elements such as classes,enumerators and assemblies.

    A declarative tag is represented by square brackets [] above the definition of the elements that is it can be above the class or it  can be above the method .

    For example:
    [attribute(positional parameters,named parameters)]
    Here, in the above example positional parameters are essential information of an attribute whereas name parameters are the optional information of an attribute.

    Attributes provide a powerful method of associating metadata, or declarative information, with code (assemblies, types, methods, properties, and so forth). After an attribute is associated with a program entity, the attribute can be queried at run time by using a technique called reflection.