Esempio n. 1
0
        public static Employee Create(Guid id, string name)
        {
            var employee = new Employee();

            var @event = new EmployeeCreated(id, name);

            employee.EventsToStore.Add(@event);

            employee.Apply(@event);

            return(employee);
        }
Esempio n. 2
0
 public void Apply(EmployeeCreated @event)
 {
     Id   = @event.Id;
     Name = @event.Name;
 }