public IMeal Cook() { var bobsWork = Task.Run(() => PastaCookingOperations.MakePasta()); var janesWork = Task.Run(() => PastaCookingOperations.MakeSauce()); return(PastaCookingOperations.Combine(bobsWork.Result, janesWork.Result)); }
public IMeal Cook() { Task <Pasta> pastaTask = PastaCookingOperations.MakePastaAsync(); Task <Sauce> sauceTask = PastaCookingOperations.MakeSauceAsync(); return(PastaCookingOperations.Combine(pastaTask.Result, sauceTask.Result)); }
public IMeal Cook() { Pasta pasta = PastaCookingOperations.MakePasta(); Sauce sauce = PastaCookingOperations.MakeSauce(); return(PastaCookingOperations.Combine(pasta, sauce)); }