public void RemoveVariant(Guid variantId) { if (IsClosed) { throw new InvalidOperationException($"IsClosed was: {IsClosed}"); } Variants.Remove(Variants.SingleOrDefault(o => o.Id == variantId)); }
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)); }