using ChainOfResponsibility.COR; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ChainOfResponsibility { internal class Client { public static void ClientCode(AbstractHandler handler) { List foods = new List() { "Nut", "Banana", "Cup of coffee", "MeatBall" }; foreach (string food in foods) { Console.WriteLine($"Client: Who wants a {food}"); var result = handler.Handle(food); if (result == null) Console.WriteLine($" {food} was left untouched"); else Console.WriteLine($" {result}"); } } } }