public void Execute() { var todoItems = _todoItemGateway.List(); Output output = CreateOutput(todoItems); _outputHandler.Handle(output); }
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 = new TodoItem(input.Title); _todoItemGateway.Add(todoItem); Output output = new Output(todoItem.Id); _outputHandler.Handle(output); }