public void Execute(Guid itemId) { ITodoItem todoItem = _todoItemGateway.Get(itemId); todoItem.MarkCompleted(); _todoItemGateway.Update(todoItem); }
public void Execute(Input input) { if (input == null) { throw new Exception("Input is null"); } if (string.IsNullOrWhiteSpace(input.Title)) { throw new Exception("Title is null"); } TodoItem todoItem = _todoItemGateway.Get(input.TodoItemId); todoItem.UpdateTitle(input.Title); _todoItemGateway.Update(todoItem); }