title: ASP.NET Core MVC application with Identity Core and Entity Framework 6
body: <p>How do I combine the identity framework version of ASP.NET Core with an Entity Framework 6 database?</p>
  
  <p>Currently I have the following: </p>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddMvc().AddMvcOptions(options =&gt;
      {
          options.Filters.Add&lt;AutorizationActionFilter&gt;();
      });
      services.AddIdentityCore&lt;ApplicationUser&gt;();
      var factory2 = new DatabaseContextFactory();
      //DatabaseContext inherits from IdentityDbContext&lt;ApplicationUser&gt;
      services.AddScoped&lt;DatabaseContext&gt;(_ =&gt; factory2.Create());
  }
  </code></pre>
  
  <p>I am getting the following error when starting the application:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.IUserStore<code>1[Supernova.Crm.DataLayer.DomainModels.ApplicationUser]' while attempting to activate 'Microsoft.AspNetCore.Identity.UserManager</code>1[Supernova.Crm.DataLayer.DomainModels.ApplicationUser]'.</p>
  </blockquote>
  
  <p>How do I resolve this error? Is there a way to resolve the error without implementing <code>IUserStore</code> myself?</p>
  
  <p>Maybe the package <code>Microsoft.AspNet.Identity.CoreCompat</code> is what I am looking for? I couldn't figure out yet how to use that package properly.</p>