コード例 #1
0
ファイル: Program.cs プロジェクト: anilarslan0/CarRental
        static void Main(string[] args)
        {
            CarDetailTest();

            //RentalManager rentalManager = new RentalManager(new EfRentalDal());
            //var result = rentalManager.GetAll();
            //if (result.Success==true)
            //{
            //    foreach (var rent in result.Data)
            //    {
            //        Console.WriteLine(rent.CustomerId,rent.RentDate,rent.ReturnDate);
            //    }
            //}

            RentalManager rentalManager = new RentalManager(new EfRentalDal());
            var           result        = rentalManager.GetAllDetail();

            if (result.Success == true)
            {
                foreach (var carDetail in result.Data)
                {
                    Console.WriteLine("kiralayan : " + carDetail.CustomerName + "araba : " + carDetail.CarName);
                }
            }

            //var result2 = rentalManager.Add(new Rental()
            //{
            //    CarId = 1,
            //    CustomerId = 1,
            //    RentDate = DateTime.Now,
            //    ReturnDate = DateTime.Now

            //});
        }