public static void BuyersAndProductsOutput(IntelligentStoreSystem store, List <Buyer> buyers) { foreach (var buyer in buyers) { Console.Write(buyer.Name + " can buy: "); store.GetsNecessaryProducts(buyer).ToList <string>().ForEach(print => Console.Write(print + "; ")); Console.WriteLine(); } }
static void Main(string[] args) { DiscountStoreSystem newPriecies = new DiscountStoreSystem(CreateProducts()); IntelligentStoreSystem store = new IntelligentStoreSystem(newPriecies.MakeADiscount()); List <Buyer> listOfBuyers = CreateBuyersList(); BuyersAndProductsOutput(store, listOfBuyers); Console.ReadKey(); }