public void MarkAsDone(TodoText text) { var createdEvent = new ItemDone( EventSourceId, text ); Apply(createdEvent); }
public void Process(ItemDone evt) { var taskList = _repositoryForTaskList.GetById(evt.ListId); var taskThatIsDone = taskList .Tasks .FirstOrDefault(task => task.Text == evt.Text) .Status = TaskStatus.Done; _repositoryForTaskList.Update(taskList); }
public void Process(ItemDone evt) { var completions = _taskCompletions.GetById(evt.ListId); if (completions == null) { completions = new TaskCompletions { Id = evt.ListId, TaskCompletion = new Dictionary <TodoText, DateTime> { [evt.Text] = DateTime.UtcNow } }; _taskCompletions.Insert(completions); } else { completions.TaskCompletion[evt.Text] = DateTime.UtcNow; _taskCompletions.Update(completions); } }