public bool CreateBooking(Models.Client.Booking booking, string rideId) { booking.Id = Guid.NewGuid().ToString(); booking.RideId = rideId; this.Db.Bookings.Add(Mapper.Map <Models.Client.Booking, Models.Data.Booking>(booking)); return(this.Db.SaveChanges() > 0); }
public bool Create(Models.Client.Booking booking) { if (booking == null) { return(false); } booking.Id = Extensions.GenerateId(); booking.BookingDate = DateTime.Now; this._db.Bookings.Add(this._mapper.Map <Models.Data.Booking>(booking)); return(this._db.SaveChanges() > 0); }