Ejemplo n.º 1
0
 public Voter(
     Guid id,
     Pesel pesel,
     bool isAdministrator,
     List <Vote> votes)
 {
     Id              = id;
     Pesel           = pesel;
     IsAdministrator = isAdministrator;
     _votes          = votes;
 }
Ejemplo n.º 2
0
        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);
        }