public Voter( Guid id, Pesel pesel, bool isAdministrator, List <Vote> votes) { Id = id; Pesel = pesel; IsAdministrator = isAdministrator; _votes = votes; }
public static Voter Create(string?pesel) { var voterId = Guid.NewGuid(); var peselValue = new Pesel(pesel); var voter = new Voter( id: voterId, pesel: peselValue, isAdministrator: false, votes: new List <Vote>()); var createdEvent = new VoterCreated(voterId); voter.Events.Add(createdEvent); return(voter); }