Gets the result value of this Task<'TResult>.
Assembly: mscorlib (in mscorlib.dll)
Accessing the property's get accessor blocks the calling thread until the asynchronous operation is complete; it is equivalent to calling the Wait method.
Once the result of an operation is available, it is stored and is returned immediately on subsequent calls to the AggregateException exception.property. Note that, if an exception occurred during the operation of the task, or if the task has been cancelled, the property does not return a value. Instead, attempting to access the property value throws an
The following example is a command-line utility that calculates the number of bytes in the files in each directory whose name is passed as a command-line argument. If the directory contains files, it executes a lambda expression that instantiates a FileStream object for each file in the directory and retrieves the value of its FileStream.Length property. If a directory contains no files, it simply calls the FromResult<'TResult> method to create a task whose property is zero (0). When the tasks finish, the total number of bytes in all a directory's files is available from the property.
Available since 8
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Available since 8.1