//EDIT********************************** internal Todo Edit(Todo editTodos) { Todo original = GetById(editTodos.todoId); original.Name = editTodos.Name != null ? editTodos.Name : original.Name; return(_repo.Edit(original)); }
internal Todo Edit(Todo updated) { Todo data = GetById(updated.Id); data.Name = updated.Name != null ? updated.Name : data.Name; data.Description = updated.Description != null ? updated.Description : data.Description; data.Completed = updated.Completed; return(_repo.Edit(data)); }
internal Todo Edit(Todo todo) { Todo original = Get(todo.Id); if (original.CreatorId != todo.CreatorId) { throw new Exception("You can't edit this."); } original.Title = todo.Title != null ? todo.Title : original.Title; original.Completed = todo.Completed != null ? todo.Completed : original.Completed; return(_todoRepo.Edit(todo)); }