예제 #1
0
 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));
 }
예제 #2
0
        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));
        }
예제 #3
0
 private void Apply(TaskReprioritized @event)
 {
     Id        = new TaskId(@event.TaskId);
     _priority = TaskPriority.Parse(@event.NewPriority);
 }