コード例 #1
0
ファイル: Program.cs プロジェクト: kaansen57/.NetCoreExample
        private static void brandManagerTest(BrandManager brandManager)
        {
            Brand brand1 = new Brand {
                BrandId = 8, BrandName = "Lamborgini"
            };
            Brand brand2 = new Brand {
                BrandId = 9, BrandName = "Audi"
            };

            brandManager.Add(brand1);
            brandManager.Add(brand2);
            var getBrand = brandManager.GetBrand(1);

            brandManager.Delete(brand2);
        }
コード例 #2
0
        private static void BrandTest(BrandManager brandManager)
        {
            Console.WriteLine("*****************Mevcut Markalar****************");
            foreach (var brand in brandManager.GetAll().Data)
            {
                Console.WriteLine("Marka Id:{0}     Marka Adı:{1}", brand.BrandId, brand.BrandName);
            }

            Console.WriteLine("\n*****************Mevcut Markalar****************");
            brandManager.Add(new Brand {
                BrandName = "Land-Rover"
            });
            foreach (var brand in brandManager.GetAll().Data)
            {
                Console.WriteLine("Marka Id:{0}     Marka Adı:{1}", brand.BrandId, brand.BrandName);
            }

            Console.WriteLine("\n*****************Mevcut Markalar****************");
            brandManager.Update(new Brand {
                BrandId = 4, BrandName = "Cadillac"
            });
            foreach (var brand in brandManager.GetAll().Data)
            {
                Console.WriteLine("Marka Id:{0}     Marka Adı:{1}", brand.BrandId, brand.BrandName);
            }

            Console.WriteLine("\n*****************Mevcut Markalar****************");
            brandManager.Delete(new Brand {
                BrandId = 4, BrandName = "Cadillac"
            });
            foreach (var brand in brandManager.GetAll().Data)
            {
                Console.WriteLine("Marka Id:{0}     Marka Adı:{1}", brand.BrandId, brand.BrandName);
            }

            Console.WriteLine("\n*****************GetBrand****************");
            Console.WriteLine(brandManager.GetBrand(2).Data.BrandName);
        }