public async Task <ActionResult <IngredientDto> > CreateIngredientAsync(IngredientForCreation ingredientForCreation) { var ingredientToAdd = _mapper.Map <Ingredient>(ingredientForCreation); await _ingredients.CreateAsync(ingredientToAdd); await _ingredients.SaveAsync(); return(CreatedAtRoute( "GetIngredient", new { ingredientId = ingredientToAdd.Id }, _mapper.Map <IngredientDto>(ingredientToAdd))); }
public async Task CreateAsync(Ingredient ingredient) { await _dal.CreateAsync(ingredient); }