C# Programming/Keywords/async
Appearance
From Wikibooks, open books for an open world
The latest reviewed version was checked on 23 January 2019. There are template/file changes awaiting review.
C# Programming
Cover | Introduction | Basics | Classes | Advanced Topics | The .NET Framework | Index
Cover | Introduction | Basics | Classes | Advanced Topics | The .NET Framework | Index
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) |