Esempio n. 1
0
        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 }));
            }
        }
Esempio n. 2
0
        public IActionResult Booking(BookParkingModel parking)
        {
            var data = _parkingService.Book(parking);

            return(Ok(data));
        }