Esempio n. 1
0
        public async Task <ActionResult> GetGarageById(int garageId)
        {
            try
            {
                GarageDto garageDto = await _garageService.GetGarageById(garageId);

                return(Response.Ok(garageDto));
            }
            catch (BaseException e)
            {
                _logger.LogInformation(ExceptionHandlerHelper.ExceptionMessageStringToLogger(e));
                return(Response.HandleExceptions(e));
            }
            catch (Exception e)
            {
                _logger.LogError(e, GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
                return(Response.InternalServerError());
            }
        }
Esempio n. 2
0
        public IActionResult Details(Guid id)
        {
            var garage = _garageService.GetGarageById(id);

            return(View(_mapper.Map <GarageViewModel>(garage)));
        }
        public IActionResult GetGarageById([FromQuery] int uid)
        {
            var result = garageService.GetGarageById(uid);

            return(new OkObjectResult(result));
        }