public CreateInfo When(CreateTaskCommand cmd) { var id = idGenerator.Next<TaskAggregate>(); var defaultName = "Task " + id; var agg = new TaskAggregate(); agg.Create(id, defaultName); repository.Save(agg); return new CreateInfo{Id = id, DefaultName = defaultName}; }