public Reservation CreateReservation( DateTime fromTime, DateTime toTime, string fromLocation, string toLocation, int carId, string userId) { var reservationToAdd = new Reservation { FromTime = fromTime, ToTime = toTime, From = fromLocation, To = toLocation, CarId = carId, UserId = userId }; this.reservations.Add(reservationToAdd); this.reservations.SaveChanges(); return reservationToAdd; }
public void UpdateReservation(Reservation item) { this.reservations.Update(item); this.reservations.SaveChanges(); }