Exemplo n.º 1
0
    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));
    }
Exemplo n.º 3
0
    public IMeal Cook()
    {
        Pasta pasta = PastaCookingOperations.MakePasta();
        Sauce sauce = PastaCookingOperations.MakeSauce();

        return(PastaCookingOperations.Combine(pasta, sauce));
    }