When is fine to use task.Result instead of await task..? i know is not recommended but there is some exception where its use is allowed? For example,if i use a task.ContinueWith is ok to inside de continuation get the result? wath will be the difference in this case if i use await?
var task = Task.Run(
() =>
{
DateTime date = DateTime.Now;
return date.Hour > 17
? "evening"
: date.Hour > 12
? "afternoon"
: "morning";
});
await task.ContinueWith(
antecedent =>
{
Console.WriteLine($"Good {antecedent.Result}!");
Console.WriteLine($"And how are you this fine {antecedent.Result}?");
}, TaskContinuationOptions.OnlyOnRanToCompletion);