In the Task Parallel Library, or the TPL in .NET, when using asynchronous operations, there seems to be two ways to await the completion of the task:
If you have this...
Task<int> intReturningTask = Task.Factory.StartNew(() => IntReturningFunc() );
You can await it with this...
int x = await intReturningTask;
but I believe you can also await it like this...
int y = intReturningTask.Result;
My question is is there a difference between the two? My guess is 'no' and that await
exists for the non-generic version of Task which doesn't have a result, but that's just speculation.