Exemplo n.º 1
0
        public async Task <IActionResult> GetFoodHubStorageById(int foodHubStorageId)
        {
            try
            {
                var            _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService);
                FoodHubStorage result           = await _serviceEndPoint.GetFoodHubStorageById(foodHubStorageId);

                FoodHubStorageViewModel resultVmodel = _Mapper.Map <FoodHubStorageViewModel>(result);
                if (result == null)
                {
                    return(NotFound(result));
                }
                return(Ok(resultVmodel));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }