When registered in MVC application for the first time. It creates some default tables
AspNetRoles,
AspNetUserClaims,
AspNetUserLogins
AspNetUserRoles
AspNetUsers
Where/or in which file are these default names written ?
When registered in MVC application for the first time. It creates some default tables
AspNetRoles,
AspNetUserClaims,
AspNetUserLogins
AspNetUserRoles
AspNetUsers
Where/or in which file are these default names written ?
I haven't been able to find where the default names are written in but if your goal is to ultimately change the names you can add the following code in your DBContext class like in this answer:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder); // This needs to go before the other rules!
modelBuilder.Entity<ApplicationUser>().ToTable("Users");
modelBuilder.Entity<IdentityRole>().ToTable("Roles");
modelBuilder.Entity<IdentityUserRole>().ToTable("UserRoles");
modelBuilder.Entity<IdentityUserLogin>().ToTable("UserLogins");
modelBuilder.Entity<IdentityUserClaim>().ToTable("UserClaims");
}
It is hard-coded in the IdentityDbContext class, check the source code for it and you will find it yoruself and if you want to override, you will find the same way as @Endi Zhupani indicated.
During creating a ASP.NET MVC project, you might have seen this screen
When you click Change Authentication as highlighted below, it will show you this screen.
Based on the type of authentication, the tables are generated. If you give No Authentication. Such tables will not be seen.
The tables are created through Entity framework and code which populates the tables are in the IdentityConfig.cs in the App_Start folder.
In short, if you want Authentication you can use the existing feature of Asp.Net or modify this existing one or create a new one.