Ejemplo n.º 1
0
        public async Task <IActionResult> CreateMeal([FromBody] Meal meal)
        {
            if (meal != null)
            {
                var result = await _mealRepository.CreateMealsAsync(meal);

                if (result != null)
                {
                    return(Created("", result));
                }
                return(BadRequest("Cannot create meal"));
            }
            return(BadRequest("No meal found"));
        }