Ejemplo n.º 1
0
        private static void BrandTest()
        {
            BrandManager brandManager = new BrandManager(new EfBrandDal());

            Console.WriteLine(brandManager.GetBrandId(2).Data.BrandName);

            brandManager.Add(new Brand {
                BrandName = "Audi"
            });
            brandManager.Delete(new Brand {
                BrandId = 3
            });
            brandManager.Update(new Brand {
                BrandId = 2, BrandName = "Renault"
            });


            foreach (var brand in brandManager.GetAll().Data)
            {
                Console.WriteLine("Brand Id :" + brand.BrandId + "---->" + "Brand Name :" + brand.BrandName);
            }


            var result = brandManager.Add(new Brand {
                BrandName = "X"
            });

            if (result.Success == true)
            {
                Console.WriteLine(result.Message);
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }