title: How to create Database context object in asp.net mvc identity project?
body: <p>I created a new ASP.NET project using this command</p>
  
  <pre><code>dotnet new mvc --auth Individual
  </code></pre>
  
  <p>It generates only Registration and Login actions. I need also create, read, update and delete actions for products model. But I could not create the DatabaseContext instance. I tried to create an object like this:</p>
  
  <pre><code>private ApplicationDbContext ctx = new ApplicationDbContext();
  </code></pre>
  
  <p>It says an error:</p>
  
  <blockquote>
    <p>There is no argument given that corresponds to the required formal
    parameter 'options' of
    'ApplicationDbContext.ApplicationDbContext(DbContextOptions)'
    [project-name]</p>
  </blockquote>
  
  <p>This is the ApplicationDbContext.cs file: </p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
      {
          public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
              : base(options)
          {
          }
  
          protected override void OnModelCreating(ModelBuilder builder)
          {
              base.OnModelCreating(builder);
              // Customize the ASP.NET Identity model and override the defaults if needed.
              // For example, you can rename the ASP.NET Identity table names and more.
              // Add your customizations after calling base.OnModelCreating(builder);
          }
      }
  </code></pre>
  
  <p>So how to create the object of ApplicationDbContext class?</p>