O'Reilly logo

Essential .NET, Volume 1: The Common Language Runtime by Chris Sells, Don Box

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required