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

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