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 <bool> SaveAsync() { return(await _dal.SaveAsync()); }