public async Task <IActionResult> DeleteFoodHub([FromBody] FoodHubViewModel foodHubViewModel) { try { var _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService); var foodHub = _Mapper.Map <FoodHub>(foodHubViewModel); bool result = await _serviceEndPoint.DeleteFoodHub(foodHub); if (!result) { return(NotFound(foodHubViewModel)); } return(Ok(new { message = "Succesfully Deleted!", result = result })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }