Exemplo n.º 1
0
        public async Task <SentRecipe> saveRecipe(SentRecipe sentRecipe, string sub)
        {
            Recipe dbRecipe = _repo.GetRecipeById(sentRecipe.RecipeId);

            if (dbRecipe == null)
            {
                dbRecipe = await _repo.SaveNewRecipe(sub);
            }
            Recipe otherRecipe = await _mapSentIntoRecipe(dbRecipe, sentRecipe);

            return(SentRecipe.GetFromRecipe(otherRecipe));
        }