示例#1
0
        public void Execute(Guid itemId)
        {
            ITodoItem todoItem = _todoItemGateway.Get(itemId);

            todoItem.MarkCompleted();
            _todoItemGateway.Update(todoItem);
        }
示例#2
0
        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);
        }