Ejemplo n.º 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);
        }