
Command Design Pattern Explained with C - Delawhere
https://dev.to/syncfusion/command-design-pattern-explained-with-c-examples-5b47
======
Delawhere
class Program { static void Main(string[] args) { DineChef dineChef = new
DineChef(); dineChef.SetOrderCommand(1); /* Insert Order _/
dineChef.SetMenuItem(new MenuItem() { TableNumber = 1, Item = "Super Mega
Burger", Quantity = 1, Tags = new List() { new Tag() { TagName =
"Jalapenos,"}, new Tag() { TagName = " Cheese," }, new Tag() { TagName = "
Tomato" }} }); dineChef.ExecuteCommand();

    
    
            dineChef.SetOrderCommand(1); /* Insert Order */
            dineChef.SetMenuItem(new MenuItem()
            {
                TableNumber = 1, Item = "Cheese Sandwich", Quantity = 1,
                Tags = new List(){ new Tag() { TagName = "Spicy Mayo,"} }
            });
            dineChef.ExecuteCommand();
            dineChef.ShowCurrentOrder();
    
            dineChef.SetOrderCommand(3); /* Remove the Cheese Sandwich */
            dineChef.SetMenuItem(new MenuItem()
            {
                TableNumber = 1, Item = "Cheese Sandwich"
            });
            dineChef.ExecuteCommand();
            dineChef.ShowCurrentOrder();
    
            dineChef.SetOrderCommand(2);/* Modify Order */
            dineChef.SetMenuItem(new MenuItem()
            {
                TableNumber = 1, Item = "Super Mega Burger", Quantity = 1,
                Tags = new List() { new Tag() { TagName = "Jalapenos,"}, new Tag() { TagName = " Cheese" }}
            });
            dineChef.ExecuteCommand();
            dineChef.ShowCurrentOrder();
            Console.ReadKey();
        }
    }

