title: NotImplemented Exceptions using MySQL Provider in ASP.NET Core With EF Core
body: <p>I am building an ASP.NET Core 1.1.0 application that needs to access an existing MySQL database using Entity Framework Core, which I'm building in Visual Studio 2015 with all the latest updates. I started using the "official" MySQL provider (MySql.Data.EntityFrameworkCore), but have the same problem with the Pomelo prvider (Pomelo.EntityFrameworkCore.MySql).</p>
  
  <p>The context object injected into my Home controller has all kinds of NotImplemented exceptions, as you can see in the image. Members is one of my DBSet collections, using the Member POCO. (By the way, I'm not planning on using migrations, so that's not a factor.) This is the state of the context object as soon as it's injected into the controller, before I even try to access data.</p>
  
  <p><a href="https://i.stack.imgur.com/m0kje.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m0kje.jpg" alt="Locals Window when in controller constructor"></a></p>
  
  <p>The full detail of a typical message is:</p>
  
  <blockquote>
    <p>((Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure)this.db.Members).Instance'
    threw an exception of type 'System.NotImplementedException</p>
  </blockquote>
  
  <p>I don't think there's anything very interesting in my project.json file, but the relevant lines are:</p>
  
  <pre><code>"Pomelo.EntityFrameworkCore.MySql": "1.1.0",
  "Pomelo.EntityFrameworkCore.MySql.Design": "1.1.0"
  </code></pre>
  
  <p>In Startup.cs in the ConfigureServices method, I have these statements:</p>
  
  <pre><code>string connectionString = Configuration.GetConnectionString("ManageRCNConnection");
  services.AddDbContext&lt;MembersContext&gt;(options =&gt; options.UseMySql(connectionString));
  </code></pre>
  
  <p>Things are pretty simple at this point.</p>
  
  <p>So far, my Google-foo has let me down trying to figure out what's wrong. </p>
  
  <p>Can anyone give me a clue about what the problem is?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Update</strong>: If I ignore the errors in the constructure as @Tseng suggests, I get errors the first time I try to get an entity from the database.</p>
  
  <p>Here is the code for my MembersContext. I've removed a few of the properties, but they are just more DbSet collections.</p>
  
  <pre><code>public class MembersContext : DbContext
  {
      public MembersContext(DbContextOptions&lt;MembersContext&gt; options) : base(options)
      { }
  
      public DbSet&lt;Member&gt; Members { get; set; }
      public DbSet&lt;FamilyMember&gt; FamilyMembers { get; set; }
      public DbSet&lt;Membership&gt; Memberships { get; set; }
      ...
  }
  </code></pre>
  
  <p>I'm not using a context factory, might that be the problem?</p>