public void Delete(string Id) { var t = Find(Id); if (context.Entry(t).State == EntityState.Detached) { dbSet.Attach(t); } dbSet.Remove(t); }
public void UpdateCar(Car car) { _dbContext.Cars.Add(car); _dbContext.Entry(car).State = System.Data.Entity.EntityState.Modified; _dbContext.SaveChanges(); }
public void UpdateReservation(Reservation res) { _dbContext.Reservations.Add(res); _dbContext.Entry(res).State = System.Data.Entity.EntityState.Modified; _dbContext.SaveChanges(); }