public IActionResult Book([FromBody] BookParkingModel model) { var parking = _mapper.Map <Parking>(model); var context = HttpContext.User.Identity; int id = int.Parse(context.Name); try { _parkingService.Book(parking, id); return(Ok(new { message = "✓ Parking Booked" })); } catch (AppException ex) { return(BadRequest(new { message = ex.Message })); } }
public IActionResult Booking(BookParkingModel parking) { var data = _parkingService.Book(parking); return(Ok(data)); }