title: How to use AutoFixture to generate data for a property that is a class?
body: <p>I'm trying to customize the data that is generated in a class .. where a property is <em>another</em> class.</p>
  
  <p>eg.</p>
  
  <pre><code>public class Foo
  {
     public string Id { get; set; }
     public Baa Baa { get; set; }
  }
  
  
  public class Baa
  {
     // 30 properties which are strings, ints, etc.
  }
  </code></pre>
  
  <p>I was wondering if i could do something like this...</p>
  
  <pre><code>var fixture = new Fixture();
  return fixture.Build&lt;Foo&gt;()
      .With(x =&gt; x.Id, $"Foo-{fixture.Create&lt;int&gt;()}")
      .With(x =&gt; x.Baa, CreateSomeCustomBaaUsingAutofixture)
      .Create();
  </code></pre>
  
  <p>and then ..</p>
  
  <pre><code>private Baa CreateSomeCustomBaaUsingAutofixture()
  {
      var fixture = new Fixture();
      return fixture.Build&lt;Baa&gt;()
          .With(lots of customizations here)
      .Create();
  }
  </code></pre>
  
  <p>Is there a cleaner way of doing this? Or is .. that basically the only/recommended way?</p>
  
  <p>I understand that AutoFixture can automatically create an instance of a <code>Baa</code> for me and data for the properties in there. I was just hoping to just customize it a bit more.</p>