예제 #1
0
        public IList<Dealer> LoadDealers(RentalSystemContext db)
        {
            IList<Dealer> holder = db.Dealers.ToList(); ;
            // db.Customers.RemoveRange(holder);

            //db.SaveChanges();
            return holder;
        }
예제 #2
0
        public List<Contract> LoadContract(RentalSystemContext db, Customer cus)
        {
            List<Contract> holder = db.Contracts.Where(x => x.Customer.CustomerId == cus.CustomerId).ToList(); ;
            // db.Customers.RemoveRange(holder);

            //db.SaveChanges();
            return holder;
        }
예제 #3
0
        public void SaveCustomers(RentalSystemContext db, IList<Customer> holder)
        {
            //IList<Customer> holder = db.Customers.ToList(); ;
            foreach (Customer gr in holder)
            {
                // Customer tr = new Customer();

                db.Customers.Add(gr);
            }
            //db.SaveChanges();
            return;
        }
예제 #4
0
 public RentalSystemContext Start()
 {
     //Database.SetInitializer(new MigrateDatabaseToLatestVersion<RentalSystemContext, Configuration>());
     RentalSystemContext db = new RentalSystemContext();
     return db;
 }