title: Customize AutoFixture property generation using constrained random values
body: <p><strong>Context</strong></p>
  
  <p>I would like to create a collection of my class, but some of its string property has constrained values. I would like to those values to be still random within the constrained set.</p>
  
  <p>I figured out the customization way, but my the random generation implementation seems to be not using any AutoFixture feature, and I do not want to reinvent the wheel:</p>
  
  <pre><code>var random = new Random();
  var fixture = new Fixture();
  fixture.Customize&lt;MyClass&gt;(b =&gt; b
      .With(i =&gt; i.MyProperty, random.Next(2) == 0 ? "O" : "C"));
  
  var result = fixture.CreateMany&lt;MyClass&gt;(1000);
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>Is there any more efficient way to tell AutoFixture that I would like a random string "O" or "C"?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Meanwhile I realized that the code above does not work at all, so it do not qualify as "backup" plan. (The expression: random.Next(2) == 0 ? "O" : "C" evaluates only once)</p>