示例#1
0
            public void Display()
            {
                Dictionary <string, List <VendingMachineItem> > Inventory = new Dictionary <string, List <VendingMachineItem> >();
                InventoryFileDAL IFD = new InventoryFileDAL();

                Inventory = IFD.GetDictionary();


                foreach (var kvp in Inventory)
                {
                    Console.WriteLine((kvp.Key) + " " + (kvp.Value[0].Name) + " " + (kvp.Value[0].Price.ToString("C")));
                }
            }
        public VendingMachine()
        {
            InventoryFileDAL IFD = new InventoryFileDAL();

            Inventory = IFD.GetDictionary();
        }