C #. What is Attribute? What features? How can I be called?

Source: Internet
Author: User

Custom attribute is essentially a class that provides associated additional information for the target element and obtains additional information (to obtain the feature class) in reflection mode at runtime ), it is equivalent to adding a tag to the element elegantly. This tag is a class.

Attribute is used to provide associated additional information for an element.

Attribute classes are instantiated during compilation, rather than being instantiated at runtime as a normal class. Attribute. GetCustomAttribute () can obtain the object of the feature class.

 

• MSDN believes that attributes describe how to serialize data, specify features for force security, and limit the optimization of the real-time (JIT) compiler, so that code can be easily debugged. Attribute can also record file names or code authors, or control the visibility of controls and members during form development.

• Dudu Boss's series of articles "Application of Attribute in. net programming" will give you a lot of inspiration in application and deserve research. Http://www.cnblogs.com/dudu/articles/4449.html

• Comrade Alexander's series of articles "teach you how to write ORM (6)" also has a good interpretation.

• Idior's article "Basic Principles and Extension Mechanism of Remoting" is also rewarding, so it is worth adding.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.