title: ServiceLifetime.Transient causes various database exceptions
body: <p>I'm dropping database, creating it again and Seeding with data.</p>
  
  <p>With this type of registry everything works fine </p>
  
  <pre><code>services.AddDbContext&lt;Context&gt;
  (
     options =&gt; options.UseSqlServer(Configuration["Database"]
  );
  </code></pre>
  
  <p>But, when I add <code>ServiceLifetime.Transient</code> then instantly it throws various exceptions like:</p>
  
  <pre><code>services.AddDbContext&lt;Context&gt;
  (
     options =&gt; options.UseSqlServer(Configuration["Database"], ServiceLifetime.Transient
  );
  </code></pre>
  
  <blockquote>
    <p>SqlException: Violation of PRIMARY KEY constraint 'PK_myTable'. Cannot insert duplicate key in object 'dbo.myTable'.
     The duplicate key value is ( [guid] ).
    The statement has been terminated.</p>
    
    <p>SqlException: Cannot insert explicit value for identity column in table 'myTable' when IDENTITY_INSERT is set to OFF.</p>
  </blockquote>
  
  <p>What may be wrong?</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, Context context, SignInManager&lt;User&gt; sm, UserManager&lt;User&gt; um)
  {
      (...)
      context.Database.EnsureDeleted();
      context.Database.EnsureCreated();
      new Initializer(context, um).Initialize().Wait();
      (...)
  }
  
  public class Initializer
  {
      private readonly UserManager&lt;User&gt; _userManager;
      private readonly Context _ctx;
  
      public Initializer(Context c, UserManager&lt;User&gt; um)
      {
          _ctx = c;
          _userManager = um;
      }
  
      public async Task Initialize()
      {
          filling my objects with data
  
          (No, I'm not setting value to Id anywhere)
          _ctx.SaveChanges();
      }
  </code></pre>
  
  <p>I bet that's because of async / .Wait()?</p>