Пример #1
0
 public static void ServedBreakFood(Toast toast, Bacon bacon, Coffie coffie, Eggs eggs)
 {
     if (toast.IsFried && toast.Jammed && toast.Buttered && coffie.IsInCup && eggs.IsFried && bacon.IsFried)
     {
         Console.WriteLine("morgenmad serveret");
     }
     else
     {
         Console.WriteLine("kunne ikke serveres noget er gået galt");
     }
 }
Пример #2
0
        public static async Task <Bacon> MakeBacon(int amount)
        {
            for (int i = 0; i < amount; i++)
            {
                Console.WriteLine("Steger bacon");
            }

            await Task.Delay(2000);

            for (int i = 0; i < amount; i++)
            {
                Console.WriteLine("Steger bacon på den anden side");
            }

            await Task.Delay(2000);

            Console.WriteLine("bacon Klar");
            Bacon bacon = new Bacon();

            bacon.IsFried = true;
            return(bacon);
        }