title: Cannot migrate IdentityModels.cs [macOS]
body: <p>Visual Studio for Mac does not automatically add the code for user authentication. I created a new MVC web application and I copied and pasted the IdentityModel.cs file from another project that someone made on Windows. I added it into my models.</p>
  
  <p>I then cd'ed into my project directory and ran the command:
  dotnet ef migrations add InitialCreate</p>
  
  <p>But I get the error:
  No DbContext was found in assembly 'Vidly'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic</p>
  
  <p>I think I have to call create() somewhere to fix it but I have no idea where it should go. Please help me.</p>
  
  <pre><code>public class IdentityModels
      {
          // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
          public class ApplicationUser : IdentityUser
          {
  
              public async Task&lt;ClaimsIdentity&gt; GenerateUserIdentityAsync(UserManager&lt;ApplicationUser&gt; manager)
              {
                  // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
                  var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
                  // Add custom user claims here
                  return userIdentity;
              }
          }
  
          public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
          {
              public ApplicationDbContext()
                  : base("DefaultConnection",throwIfV1Schema: false)
              {
              }
  
              public static ApplicationDbContext Create()
              {
                  return new ApplicationDbContext();
              }
          }
      }
  </code></pre>