public async Task <BookingModel> SaveBooking(BookingModel model) { var entity = model.Map(); try { await _ctx.Bookings.AddAsync(entity); await _ctx.SaveChangesAsync(); } catch (DbUpdateException dbu) { // log } return(entity.Map()); }
public async Task AddCar(CarModel car) { await _ctx.Cars.AddAsync(car.Map()); await _ctx.SaveChangesAsync(); }