Ejemplo n.º 1
0
        public IActionResult GetById(int id)
        {
            try
            {
                DayMeal = dayMealData.GetById(id);

                if (DayMeal == null)
                {
                    return(NotFound($"Could not find entity with id:{id}"));
                }

                return(Ok(ApiRepository.DayMealToDto(DayMeal)));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }
        }