Not able to call asynchronous methods in correct order concurrently in C#

I am learning async methods in C#, and I am trying to create a small program that calls few methods in sequence with a small delay. at the end of the operation, I am calculating the total time elapsed. Here is my code.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>public static async Task<string> MakeCoffeeAsync()
{
Thread.Sleep(3000);
return("Coffee is Ready");
}
public static async Task<string> ToastBreadAsync()
{
Thread.Sleep(2000);
return ("Bread is Toasted");
}
public static async Task<string> ApplyJamToBreadAsync()
{
Thread.Sleep(1000);
return ("Jam added to Bread");
}
public static async void MakeBreakfast()
{
Console.WriteLine("Making Breakfast async way");
Stopwatch sw = new Stopwatch();
sw.Start();
Console.WriteLine(await MakeCoffeeAsync());
Console.WriteLine(await ToastBreadAsync());
Console.WriteLine(await ApplyJamToBreadAsync());
sw.Stop();
Console.WriteLine("Normal Way - Total Time Taken " + sw.ElapsedMilliseconds / 1000 + " Seconds");
}
</code>
<code>public static async Task<string> MakeCoffeeAsync() { Thread.Sleep(3000); return("Coffee is Ready"); } public static async Task<string> ToastBreadAsync() { Thread.Sleep(2000); return ("Bread is Toasted"); } public static async Task<string> ApplyJamToBreadAsync() { Thread.Sleep(1000); return ("Jam added to Bread"); } public static async void MakeBreakfast() { Console.WriteLine("Making Breakfast async way"); Stopwatch sw = new Stopwatch(); sw.Start(); Console.WriteLine(await MakeCoffeeAsync()); Console.WriteLine(await ToastBreadAsync()); Console.WriteLine(await ApplyJamToBreadAsync()); sw.Stop(); Console.WriteLine("Normal Way - Total Time Taken " + sw.ElapsedMilliseconds / 1000 + " Seconds"); } </code>
public static async Task<string> MakeCoffeeAsync()
{
    Thread.Sleep(3000);
    return("Coffee is Ready");           
}

public static async Task<string> ToastBreadAsync()
{
    Thread.Sleep(2000);
    return ("Bread is Toasted");
}

public static async Task<string> ApplyJamToBreadAsync()
{
    Thread.Sleep(1000);
    return ("Jam added to Bread");
}

public static async void MakeBreakfast()
    {
        Console.WriteLine("Making Breakfast async way");

        Stopwatch sw = new Stopwatch();
        sw.Start();

        Console.WriteLine(await MakeCoffeeAsync());
        Console.WriteLine(await ToastBreadAsync());
        Console.WriteLine(await ApplyJamToBreadAsync());            

        sw.Stop();
        Console.WriteLine("Normal Way - Total Time Taken " + sw.ElapsedMilliseconds / 1000 + " Seconds");
    }

This is working correctly and I am getting 6 Seconds as output which is correct.

Now I want two tasks to start simultaneously. One Task can start making the coffee (This will take 3 seconds), and second task will Start the Toast (This will take 2 seconds) and Once the toast is ready, the second task will apply Jam to the already toasted bread (This will take 1 second). The sequence is important for Toast. The Jam should only be applied after the Toast is ready.

Expected output : Total elapsed time should be 3 seconds. Because coffee and (Toast + Jam) will run parallelly.

This is what I have tried.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> public static async void MakeBreakfastConcurrent()
{
Console.WriteLine("Making Breakfast Concurrent way");
Stopwatch sw = new Stopwatch();
sw.Start();
await Task.Run(() => Console.WriteLine(MakeCoffeeAsync()));
await Task.Run(() => {
Console.WriteLine(ToastBreadAsync());
Console.WriteLine(ApplyJamToBreadAsync());
});
sw.Stop();
Console.WriteLine("Normal Way - Total Time Taken " + sw.ElapsedMilliseconds / 1000 + " Seconds");
}
</code>
<code> public static async void MakeBreakfastConcurrent() { Console.WriteLine("Making Breakfast Concurrent way"); Stopwatch sw = new Stopwatch(); sw.Start(); await Task.Run(() => Console.WriteLine(MakeCoffeeAsync())); await Task.Run(() => { Console.WriteLine(ToastBreadAsync()); Console.WriteLine(ApplyJamToBreadAsync()); }); sw.Stop(); Console.WriteLine("Normal Way - Total Time Taken " + sw.ElapsedMilliseconds / 1000 + " Seconds"); } </code>
    public static async void MakeBreakfastConcurrent()
    {
        Console.WriteLine("Making Breakfast Concurrent way");

        Stopwatch sw = new Stopwatch();
        sw.Start();
                    
        await Task.Run(() => Console.WriteLine(MakeCoffeeAsync()));

        await Task.Run(() => {
            Console.WriteLine(ToastBreadAsync());
            Console.WriteLine(ApplyJamToBreadAsync());
        });
     
        sw.Stop();
        Console.WriteLine("Normal Way - Total Time Taken " + sw.ElapsedMilliseconds / 1000 + " Seconds");
    }

But this is not working as expected. When I run this, nothing prints after "Making Breakfast Concurrent way"

What am I doing wrong, and how to achieve the correct execution order in concurrent way? (probably something like .then() in JS ?)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật