I am trying to separate my entity map, but when I do this, no changes are applied to the database. Why?
Below is my code:
class UserMap : EntityTypeConfiguration<User>
{
public UserMap()
{
this.ToTable("User");
this.HasKey<int>(p => p.Id);
this.Property(u => u.UserPin).IsRequired().HasMaxLength(2000);
}
}
public class ProjectDbContext : DbContext
{
public ProjectDbContext()
: base("name=DefaultConnectionString")
{
}
public DbSet<Project> Projects { get; set; }
public DbSet<Image> Images { get; set; }
public DbSet<User> Users { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Configurations.Add(new UserMap());
}
}
How to apply my card configuration to apply?
source
share