Contextual Keywords
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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.

© 2016 Microsoft