示例#1
0
        public void Delete(string Id)
        {
            var t = Find(Id);

            if (context.Entry(t).State == EntityState.Detached)
            {
                dbSet.Attach(t);
            }

            dbSet.Remove(t);
        }
示例#2
0
 public void UpdateCar(Car car)
 {
     _dbContext.Cars.Add(car);
     _dbContext.Entry(car).State = System.Data.Entity.EntityState.Modified;
     _dbContext.SaveChanges();
 }
示例#3
0
 public void UpdateReservation(Reservation res)
 {
     _dbContext.Reservations.Add(res);
     _dbContext.Entry(res).State = System.Data.Entity.EntityState.Modified;
     _dbContext.SaveChanges();
 }