title: Unable to create an object of type 'ApplicationDbContext'. For the different patterns supported at design time
body: <p>I face the following error when adding the migration of database in .net core</p>
  <p>This is the error:</p>
  <p><a href="https://i.stack.imgur.com/pm3dd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pm3dd.png" alt="" /></a></p>
  <p>This is the code in <code>Startup</code>:</p>
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt; 
      options.UseSqlServer(Configuration.GetConnectionString(&quot;DefaultConnection&quot;)));
             
      services.AddDefaultIdentity&lt;ApplicationUser&gt;().AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();
      services.AddControllers();
  }
  </code></pre>
  <p>This is the <code>ApplicationDbContext</code> class:</p>
  <pre class="lang-cs prettyprint-override"><code>public class ApplicationDbContext : IdentityDbContext
  {
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options) : base(options)
      { }
  
      public DbSet&lt;ApplicationUser&gt; applicationUsers { get; set; }
  }
  </code></pre>
  <p>This is the <code>ApplicationUser</code>:</p>
  <pre class="lang-cs prettyprint-override"><code>public class ApplicationUser : IdentityUser
  {
      [Required]
      [Column(TypeName = &quot;nvarchar(150)&quot;)]
      public string UserFName { get; set; }
      [Required]
      public string UserLName { get; set; }
  }
  </code></pre>