public Task(ProjectId projectId, Title title, TaskPriority priority) : base(TaskId.Create(projectId, title)) { if (title == null) { throw new ArgumentNullException("title"); } if (priority == null) { throw new ArgumentNullException("priority"); } ApplyChange(new TaskRegistered(Id, projectId, title, priority.DisplayName)); }
public void Reprioritize(TaskPriority newPriority) { if (newPriority == null) { throw new ArgumentNullException("newPriority"); } if (newPriority.Equals(_priority)) { return; } ApplyChange(new TaskReprioritized(Id, _priority.DisplayName, newPriority.DisplayName)); }
private void Apply(TaskReprioritized @event) { Id = new TaskId(@event.TaskId); _priority = TaskPriority.Parse(@event.NewPriority); }