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); }
public void Apply(EmployeeCreated @event) { Id = @event.Id; Name = @event.Name; }