C# Programming/Keywords/await
The async
and await
contextual keywords are used in asynchronous programming. Asynchronous programming allows a process to wait until a method completes and returns a value (or times out or otherwise fails). The keyword async
must be used to modify a method or lambda expression that contains an await
expression or method. These two keywords make asynchronous programming easy to implement. Simply preface any potentially long-running call with the await
keyword, e.g., var text = await
getLargeDataSet(); and add the async
modifier to the containing method (or lambda expression). The async and await keywords are available in JavaScript and other languages and were introduced in C# version 5.0.
C# Keywords | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Special C# Identifiers (Contextual Keywords) | |||||||||||||||
| |||||||||||||||
Contextual Keywords (Used in Queries) | |||||||||||||||
|