public void When(NewTaskScheduled e) { writer.Add(e.Id, new TaskDetailsView { Id = e.Id, TaskName = e.TaskName, Instructions = e.Instructions, DueDateTime = e.DueDateTime, TaskStatus = TaskStatus.Draft, CandidateIds = e.CandidateIds, AnimalIds = e.AnimalIds }); }
public void When(ScheduleNewTask c) { if (state.Version > 0) throw new Exception("Cannot create the same aggregate twice."); var e = new NewTaskScheduled { Id = c.Id, TaskName = c.TaskName, Instructions = c.Instructions, DueDateTime = c.DueDateTime, CandidateIds = c.CandidateIds, AnimalIds = c.AnimalIds }; Apply(e); }