Created
November 12, 2017 14:13
-
-
Save luisdeol/a669edc4411be01befc556cf3a2dfd86 to your computer and use it in GitHub Desktop.
Using ContinueWith on Tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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