title: How to use IdentityDbContext
body: <p>For the last few days, I have been playing around with Asp.net's Identity framework. </p>
  
  <p>I have been able to get the Register and Login working however when I try to extend the functionality to saving data against specific users, I find it is different to how I would normally implement it with stock standard EF. </p>
  
  <p>Normally I would use something like below to save data:</p>
  
  <pre><code>using(var context = myDbContex())
  {
     context.Add(object);
     context.SaveChanges();
  }
  </code></pre>
  
  <p>However, when I try to use this approach after inheriting the IdentityDbContext it is expecting an argument. Is it okay for me to create a default constructor that doesn't take any arguments or should I be passing something in?</p>
  
  <p>My Context currently looks like this:</p>
  
  <pre><code>public class AppContext : IdentityDbContext&lt;ApplicationUser&gt;
      {
          //I am not really sure why options needs to be specified as an argument   
          public AppContext(DbContextOptions&lt;AppContext&gt; options)
              : base(options)
          {
          }
  
          public DbSet&lt;ApplicationUser&gt; ApplicationUsers { get; set; }
  
          public DbSet&lt;Xxxxx&gt; Xxxxx { get; set; }
  
          public DbSet&lt;Yyyyy&gt; Yyyyy { get; set; }
  
          public DbSet&lt;Zzzzz&gt; Zzzzz { get; set; }
  
          protected override void OnModelCreating(ModelBuilder builder)
          {
              base.OnModelCreating(builder);
          }
      }
  </code></pre>
  
  <p>In Startup.cs</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
      {
          services.AddDbContext&lt;AppContext&gt;(options =&gt;
                                                          options.UseSqlite("Data Source=App.db"));
  
          services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;()
              .AddEntityFrameworkStores&lt;AppContext&gt;()
              .AddDefaultTokenProviders();
          });
  </code></pre>
  
  <p>Why is this implementation of the context different to the standard dbContext, and how can I save data using this context?</p>
  
  <p>Thanks</p>