Exemplo n.º 1
0
        public async Task <IActionResult> PostCreateFoodHubStorage([FromBody] FoodHubViewModel foodHubViewModel)
        {
            try
            {
                var            _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService);
                FoodHubStorage foodHubStorage   = _Mapper.Map <FoodHubStorage>(foodHubViewModel);
                bool           result           = await _serviceEndPoint.PostCreateFoodHubStorage(foodHubStorage);

                if (!result)
                {
                    return(NotFound(foodHubViewModel));
                }
                return(Ok(new { message = "Succesfully Created!", result = result }));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }