If you are using ASP.NET Identity, the correct is your Usuario
inherit from IdentityUser
:
public class Usuario : IdentityUser { ... }
The table naming configuration can be changed through the OnModelCreating
event using Fluent API :
public class ApplicationDbContext : IdentityDbContext<Usuario>
{
public ApplicationDbContext()
: base("DefaultConnection")
{
}
protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<IdentityUser>()
.ToTable("Usuarios", "dbo").Property(p => p.Id).HasColumnName("UsuarioId");
modelBuilder.Entity<Usuario>()
.ToTable("Usuarios", "dbo").Property(p => p.Id).HasColumnName("UsuarioId");
}
}
Similarly, this can be done for IdentityUserClaim
:
public class UsuarioIdentificacao : IdentityUserClaim { ... }
And the setting:
modelBuilder.Entity<IdentityUserClaim>()
.ToTable("UsuarioIdentificacoes", "dbo").Property(p => p.Id).HasColumnName("UsuarioIdentificacaoId");
modelBuilder.Entity<UsuarioIdentificacao>()
.ToTable("UsuarioIdentificacoes", "dbo").Property(p => p.Id).HasColumnName("UsuarioIdentificacaoId");