Special Methods
The motivation for having rich metadata is to more accurately retain and convey the intentions of the programmer. For example, programmers often define a pair of methods that correspond to a named value. Typically, one of the methods gets the value, and the other method sets the value. A CLR type can contain additional metadata that indicates which methods are intended to be used in this fashion. This additional metadata is formally called a property.
A CLR property is a member of a type that specifies one or two methods that correspond to a named value that is affiliated with the type. Like a field, a property has a name and a type. However, unlike a field, a property has no allocated storage. Rather, a property is simply a named ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access