Skip to content

Instantly share code, notes, and snippets.

@luisdeol
Created November 12, 2017 14:13
Show Gist options
  • Save luisdeol/a669edc4411be01befc556cf3a2dfd86 to your computer and use it in GitHub Desktop.
Save luisdeol/a669edc4411be01befc556cf3a2dfd86 to your computer and use it in GitHub Desktop.
Using ContinueWith on Tasks
namespace MultiThreadingExamples
{
class Program
{
static void Main(string[] args)
{
Task<string> thePowerfulTaskWithReturn = Task
.Run(() => "Luis is ")
.ContinueWith((firstResult) => firstResult.Result + " sleepy!");
Console.WriteLine(thePowerfulTaskWithReturn.Result);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment