From 56f8e0d0a5ca5d23ce6bf50672f6ff193c2c466a Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Wed, 11 Jul 2018 13:33:15 -0700 Subject: [PATCH] Corrected variable name --- .../programming-guide/concepts/async/async-return-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/programming-guide/concepts/async/async-return-types.md b/docs/csharp/programming-guide/concepts/async/async-return-types.md index 23cf79c7f708a..9351c7415d655 100644 --- a/docs/csharp/programming-guide/concepts/async/async-return-types.md +++ b/docs/csharp/programming-guide/concepts/async/async-return-types.md @@ -27,7 +27,7 @@ In the following example, the `GetLeisureHours` async method contains a `return` When `GetLeisureHours` is called from within an await expression in the `ShowTodaysInfo` method, the await expression retrieves the integer value (the value of `leisureHours`) that's stored in the task returned by the `GetLeisureHours` method. For more information about await expressions, see [await](../../../../csharp/language-reference/keywords/await.md). -You can better understand how this happens by separating the call to `GetLeisureHours` from the application of `await`, as the following code shows. A call to method `GetLeisureHours` that isn't immediately awaited returns a `Task`, as you would expect from the declaration of the method. The task is assigned to the `integerTask` variable in the example. Because `integerTask` is a , it contains a property of type `TResult`. In this case, TResult represents an integer type. When `await` is applied to `integerTask`, the await expression evaluates to the contents of the property of `integerTask`. The value is assigned to the `ret` variable. +You can better understand how this happens by separating the call to `GetLeisureHours` from the application of `await`, as the following code shows. A call to method `GetLeisureHours` that isn't immediately awaited returns a `Task`, as you would expect from the declaration of the method. The task is assigned to the `infoTask` variable in the example. Because `infoTask` is a , it contains a property of type `TResult`. In this case, `TResult` represents an integer type. When `await` is applied to `infoTask`, the await expression evaluates to the contents of the property of `infoTask`. The value is assigned to the `ret` variable. > [!IMPORTANT] > The property is a blocking property. If you try to access it before its task is finished, the thread that's currently active is blocked until the task completes and the value is available. In most cases, you should access the value by using `await` instead of accessing the property directly.
The previous example retrieved the value of the property to block the main thread so that the `ShowTodaysInfo` method could finish execution before the application ended.