Exemplo n.º 1
0
        public async Task <IActionResult> GetLocationById(int locationId)
        {
            try
            {
                var      _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService);
                Location res = await _serviceEndPoint.GetLocationById(locationId);

                LocationViewModel results = _Mapper.Map <LocationViewModel>(res);
                if (results == null)
                {
                    return(NotFound(results));
                }
                return(Ok(results));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }