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)); }
public async Task <Ingredient> GetAsync(int ingredientId) { return(await _dal.GetAsync(ingredientId)); }