Esempio n. 1
0
    private static void FindByNameMethod(string input, ProductCollection colection)
    {
        int index;

        index = input.IndexOf(' ');
        string findName = input.Substring(index + 1);
        var    product  = colection.FindProductsByName(findName);

        if (!product.Any())
        {
            Console.WriteLine("No products found");
        }
        else
        {
            foreach (var item in product)
            {
                Console.Write("{");
                Console.Write("{0};{1};{2:f2}", item.Name, item.Producer, item.Price);
                Console.WriteLine("}");
            }
        }
    }