title: UserId not found, add users and roles in migration seed
body: <p>I have this seed in Migrations/Configuration.cs</p>
  
  <pre><code>    protected override void Seed(xxx.xxx.ApplicationDbContext context)
      {
  
          var UserManager = new UserManager&lt;ApplicationUser&gt;(new UserStore&lt;ApplicationUser&gt;(context));
          var RoleManager = new RoleManager&lt;IdentityRole&gt;(new RoleStore&lt;IdentityRole&gt;(context));
          string role = "Admin";
          string password = "Password@1234";
  
          //Create Role Admin if it does not exist
          if (!RoleManager.RoleExists(role))
          {
              var roleresult = RoleManager.Create(new IdentityRole(role));
          }
  
          //Create Admin users with password=123456
          var admin1 = new ApplicationUser();
          admin1.UserName = "admin1@admin1.com";
          admin1.Email = "admin1@admin1.com";
          admin1.EmailConfirmed = true;
          UserManager.Create(admin1, password);
          UserManager.AddToRole(admin1.Id, role);
  
          //Create Admin users with password=123456
          var admin2 = new ApplicationUser();
          admin2.UserName = "admin2@admin2.com";
          admin2.Email = "admin2@admin2.com";
          admin2.EmailConfirmed = true;
          UserManager.Create(admin2, password);
          UserManager.AddToRole(admin2.Id, role);
  
          //Create Admin users with password=123456
          var admin3 = new ApplicationUser();
          admin3.UserName = "admin3@admin3.com";
          admin3.Email = "admin3@admin3.com";
          admin3.EmailConfirmed = true;
          UserManager.Create(admin3, password);
          UserManager.AddToRole(admin3.Id, role);
  
          context.SaveChanges();           
      }
  </code></pre>
  
  <p>I get the error message "UserId not found" If I in PM run "update-database" or doing a deploy with the checkbox "Execute code first migration" checked.</p>
  
  <p><strong>EDIT</strong>
  I have renamed my user table to from <code>AspNetUsers</code> to <code>Users</code>, see code below in IdentityModels</p>
  
  <pre><code>// Change the name of the table to be Users instead of AspNetUsers
              modelBuilder.Entity&lt;IdentityUser&gt;()
                  .ToTable("Users").Property(p =&gt; p.Id).HasColumnName("UserID");
              modelBuilder.Entity&lt;ApplicationUser&gt;()
                  .ToTable("Users").Property(p =&gt; p.Id).HasColumnName("UserID");
  </code></pre>
  
  <p>Some trace log</p>
  
  <blockquote>
    <p>[InvalidOperationException: UserId not found.]<br>
    Microsoft.AspNet.Identity.d__83.MoveNext() +1279<br>
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
    task) +93<br>
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task) +52    Microsoft.AspNet.Identity.AsyncHelper.RunSync(Func<code>1
    func) +266<br>
    Microsoft.AspNet.Identity.UserManagerExtensions.AddToRole(UserManager</code>2
    manager, TKey userId, String role) +119<br>
    xxx.Migrations.Configuration.Seed(ApplicationDbContext context)
    +292    System.Data.Entity.Migrations.DbMigrationsConfiguration<code>1.OnSeed(DbContext
    context) +42<br>
    System.Data.Entity.Migrations.DbMigrator.SeedDatabase() +102<br>
    System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable</code>1
    pendingMigrations, String targetMigrationId, String lastMigrationId)
    +448    System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration) +446<br>
    System.Data.Entity.Migrations.&lt;>c__DisplayClassc.b__b() +13<br>
    System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action
    mustSucceedToKeepDatabase) +422<br>
    System.Data.Entity.Migrations.DbMigrator.Update(String
    targetMigration) +78</p>
  </blockquote>