Exemplo n.º 1
0
        public void RemoveVariant(Guid variantId)
        {
            if (IsClosed)
            {
                throw new InvalidOperationException($"IsClosed was: {IsClosed}");
            }

            Variants.Remove(Variants.SingleOrDefault(o => o.Id == variantId));
        }
Exemplo n.º 2
0
        public void Vote(Guid variantId, Person person)
        {
            if (IsClosed)
            {
                throw new InvalidOperationException($"IsClosed was: {IsClosed}");
            }

            var variant = Variants.SingleOrDefault(o => o.Id == variantId);

            variant.Vote(new Votes.Vote(Guid.NewGuid(), person, variant));
        }