Ejemplo n.º 1
0
 public void Apply(VotingCreatedEvent @event)
 {
     Id          = @event.VotingId;
     _topics     = @event.Topics;
     _votingPair = VotingPair.Empty();
     _winner     = string.Empty;
 }
Ejemplo n.º 2
0
        public VotingSnapshot(Guid votingId, VotingPair votingPair, string winner)
        {
            VotingId = votingId;
            Winner   = winner;

            votingPair = votingPair ?? VotingPair.Empty();
            Topics     = new Dictionary <string, int> ();
            if (!votingPair.IsEmpty)
            {
                Topics.Add(votingPair.TopicA.topic, votingPair.TopicA.votes);
                Topics.Add(votingPair.TopicB.topic, votingPair.TopicB.votes);
            }
        }