Beispiel #1
0
        private static bool Get(string[] fields)
        {
            if (fields[0] != "get")
            {
                return(false);
            }

            if (fields.Length < 2)
            {
                return(false);
            }

            string name = fields[1] == null ? null : fields[1];

            var result = shoppingList.Get(name);

            Console.Out.WriteLine($"Item '{name}': {result}.");

            return(true);
        }