public TimeRegistration(Guid id, Client client, Project project, Task task,
                         string description, Date date, Time from, Time to)
 {
     ApplyChange(new TimeRegistrationCreated(id, client.Id, project.Id, 
                                             task.Name, task.Rate,
                                             description, date, from, to, 
                                             DateTime.UtcNow));
 }
        public void ChangeDetails(Client client, Project project, Task task,
                                  string description, Date date, Time from, Time to)
        {
            if (Deleted)
                throw new AggregateDeletedException();

            if (ClientId != client.Id || ProjectId != project.Id ||
                Task != task.Name || Description != description ||
                Date != date || From != from || To != to)
            {
                ApplyChange(new TimeRegistrationDetailsChanged(Id, client.Id, project.Id,
                                                               task.Name, description, date, from, to));
            }
        }