Contextual Keywords
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Contextual Keywords (C# Reference)

A contextual keyword is used to provide a specific meaning in the code, but it is not a reserved word in C#. The following contextual keywords are introduced in this section:

get   Defines an accessor method for a property or an indexer.

partial   Defines partial classes, structs, and interfaces throughout the same compilation unit.

set   Defines an accessor method for a property or an indexer.

where   Adds constraints to a generic declaration.

yield   Used in an iterator block to return a value to the enumerator object or to signal the end of iteration.

value   Used to set accessors and to add or remove event handlers.

Show:
© 2016 Microsoft