static void Main(string[] args) { Car car = new Car(); car.Id = 5; car.BrandId = 6; car.ColorId = 10; car.DailyPrice = 350; car.Description = "Peugoet 301"; car.ModelYear = 2016; ICarDal cars = new InMemoryCarDal(); cars.Add(car); cars.Delete(3); cars.GetAll(); cars.GetById(4); cars.Update(2, car); }
static void Main(string[] args) { CarManager carManager = new CarManager(new InMemoryCarDal()); foreach (var car in carManager.GetAll()) { Console.WriteLine(car.Description); } InMemoryCarDal inMemoryCarDal = new InMemoryCarDal(); inMemoryCarDal.Add(new Car { Id = 6, BrandId = 2, ColorId = 2, DailyPrice = 20000, ModelYear = 1985, Description = "Pembe Araba" }); inMemoryCarDal.Update(new Car { Id = 6, BrandId = 2, ColorId = 2, DailyPrice = 60000, ModelYear = 1975, Description = "Lacivert Araba" }); inMemoryCarDal.Delete(new Car { Id = 6 }); Console.ReadLine(); }