Wednesday, October 29, 2008
Contextual Keywords in C#
Keywords are predefined reserved identifiers that have special meanings to the compiler. They cannot be used as identifiers in program unless they include @ as a prefix. For example, @if is a legal identifier but if is not because it is a keyword.
A contextual keyword is used to provide a specific meaning in the code, but it is not a reserved word in C#.
var query = from customer in db.Customer where customer.city=="Chennai"
here where is the Contextual keyword it has significant meaning , but outside of this statement where has no meaning so we can use as an identifier.
C# Contextual Keywords
get , partial , set ,value , where , yield
Posted by Sreeni.NET at 9:28 AM