title: Autofixture and read only properties
body: <p>Let's consider two version (one with read only properties) of the same very simple entity:</p>
  
  <pre><code>public class Client
  {
      public Guid Id { get; set; }
  
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>vs </p>
  
  <pre><code>public class Client
  {
      public Client(Guid id, string name)
      {
          this.Id = id;
          this.Name = name;
      }
  
      public Guid Id { get; }
  
      public string Name { get; }
  }
  </code></pre>
  
  <p>When I try to use Autofixture, it will work correctly and as expected with both of them. The problems start, when I try to predefine one of the parameters using .<code>with()</code> method:</p>
  
  <pre><code>var obj = this.fixture.Build&lt;Client&gt;().With(c =&gt; c.Name, "TEST").Build();
  </code></pre>
  
  <p>This will throw error </p>
  
  <blockquote>
    <p>System.ArgumentException: The property "Name" is read-only.</p>
  </blockquote>
  
  <p>But it seems that Autofixture knows how to use constructors! And it seems that actual <code>Build&lt;&gt;()</code> method creates an instance of an object not <code>Create()</code>! If build would just prepare builder, with would setup properties, and then Create would instantiate object it would work properly with read only properties.</p>
  
  <p>So why was this (misleading) strategy used here? I've found an answer <a href="https://stackoverflow.com/a/20816487/2588795">here</a> that states it's to amplify feedback with tests, but I don't see the usefulness to use <code>FromFactory()</code> especially when a list of parameters is extensive. Wouldn't moving object instantiation from <code>Build()</code> method to <code>Create()</code> method be more intuitive?</p>