title: EF Core 1.1 Migration - The current CSharpHelper cannot scaffold literals of type
body: <p>This seems to be a really obscure error, and I don't even know where to start with it...</p>
  
  <blockquote>
    <p>The current CSharpHelper cannot scaffold literals of type
    'System.Func`3[Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator]'.
    Configure your services to use one that can.</p>
  </blockquote>
  
  <p>This is occurring when I run</p>
  
  <pre><code>dotnet ef migrations add initial
  </code></pre>
  
  <p><strong>Update 1 - based on Rob's question</strong></p>
  
  <p>The architecture of the application uses a rich domain model, so there are a few "workarounds" to get things like encapsulated collections, and Jimmy Bogard's typed enumeration pattern working.</p>
  
  <p>Each domain model object has it's own <code>EntityTypeBuilder</code> class in the data access layer, all of which are called from <code>OnModelCreating</code> in the <code>DbContext</code>. These also output some information to the <code>Console</code>, so I can see that the builder isn't causing any errors (none of them are at this point).</p>
  
  <p>The <code>DbContext</code> only exposes <code>DbSet</code> for aggregate root entities, or to put it another way, only entities that have a corresponding repository class. The rest of the domain model objects are navigation properties, and therefore do not require <code>DbSet</code> to be exposed via the <code>DbContext</code>.</p>
  
  <p>Platform specifics (as far as I'm aware)</p>
  
  <ul>
  <li>.NET Core 1.1 (Runtime + SDK)</li>
  <li>EF Core 1.1</li>
  <li>Microsoft.EntityFrameworkCore.Tools 1.0.0-preview2-final</li>
  <li>Microsoft.EntityFrameworkCore.Design 1.0.0-preview2-final</li>
  </ul>