public async Task <ActionResult <IngredientDto> > GetIngredientAsync(int ingredientId)
        {
            var ingredientFromRepo = await _ingredients.GetAsync(ingredientId);

            if (ingredientFromRepo == null)
            {
                return(NotFound());
            }

            var ingredientDto = _mapper.Map <IngredientDto>(ingredientFromRepo);

            return(Ok(ingredientDto));
        }
Пример #2
0
 public async Task <Ingredient> GetAsync(int ingredientId)
 {
     return(await _dal.GetAsync(ingredientId));
 }