Skip to content

Instantly share code, notes, and snippets.

@theuntitled
Created August 31, 2016 15:43
Show Gist options
  • Select an option

  • Save theuntitled/abdfa024675635f341e16e18b7969325 to your computer and use it in GitHub Desktop.

Select an option

Save theuntitled/abdfa024675635f341e16e18b7969325 to your computer and use it in GitHub Desktop.
Entity Framework Core - Identity AspNet Tables
...
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<User>().ForSqlServerToTable("Users");
builder.Entity<IdentityRole>().ForSqlServerToTable("Roles");
builder.Entity<IdentityUserRole<string>>().ForSqlServerToTable("UserRoles");
builder.Entity<IdentityUserClaim<string>>().ForSqlServerToTable("UserClaims");
builder.Entity<IdentityRoleClaim<string>>().ForSqlServerToTable("RoleClaims");
builder.Entity<IdentityUserLogin<string>>().ForSqlServerToTable("UserLogins");
builder.Entity<IdentityUserToken<string>>().ForSqlServerToTable("UserTokens");
base.OnModelCreating(builder);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment