internal Recipe Edit(Recipe editRecipe) { Recipe recipe = GetOne(editRecipe.Id); _repo.Edit(editRecipe); return(editRecipe); }
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)); }