//edit/put internal Flower Edit(Flower updatedFlower) { Flower found = Get(updatedFlower.Id); found.Name = updatedFlower.Name; found.Price = updatedFlower.Price != 0 ? updatedFlower.Price : found.Price; return(_repo.Edit(found)); }
internal Flower Edit(Flower updated) { var original = GetById(updated.Id); updated.name = updated.name != null ? updated.name : original.name; updated.description = updated.description != null ? updated.description : original.description; updated.price = updated.price > 0 ? updated.price : original.price; return(_repo.Edit(updated)); }