예제 #1
0
        internal Recipe Edit(Recipe editRecipe)
        {
            Recipe recipe = GetOne(editRecipe.Id);

            _repo.Edit(editRecipe);
            return(editRecipe);
        }
예제 #2
0
        internal Recipe Edit(Recipe updated)
        {
            var data = GetById(updated.Id);

            updated.Description = updated.Description != null ? updated.Description : data.Description;
            updated.Title       = updated.Title != null && updated.Title.Length > 2 ? updated.Title : data.Title;
            updated.ImgUrl      = updated.ImgUrl != null ? updated.ImgUrl : data.ImgUrl;
            return(_repo.Edit(updated));
        }