Пример #1
0
        private static void ColourTest()
        {
            ColourManager colourManager = new ColourManager(new EfColourDal());

            foreach (var colour in colourManager.GetAll())
            {
                Console.WriteLine(colour.ColourName + "/" + colour.ColourId);
            }

            foreach (var colour in colourManager.GetById(3))
            {
                Console.WriteLine(colour.ColourId + "/" + colour.ColourName);
            }

            Colour colourAdd = new Colour()
            {
                ColourName = "Dark Blue"
            };

            colourManager.Add(colourAdd);

            foreach (var colour in colourManager.GetAll())
            {
                Console.WriteLine(colour.ColourName + "/" + colour.ColourId);
            }

            colourManager.Delete(2002);
            foreach (var colours in colourManager.GetAll())
            {
                Console.WriteLine(colours.ColourName);
            }

            colourManager.Update(1);
        }
Пример #2
0
        private static void ColourAllTest()
        {
            ColourManager colourManager = new ColourManager(new EfColourDal());
            var           result        = colourManager.GetAll().Data;

            foreach (var colour in result)
            {
                Console.WriteLine(colour.ColourName);
            }
            Console.WriteLine();
            Console.WriteLine(colourManager.GetAll().Message);
        }