Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        public void UpdateReservation(Reservation item)
        {
            this.reservations.Update(item);

            this.reservations.SaveChanges();
        }