In EF6 we usually able to use this way to configure the Entity.
public class AccountMap : EntityTypeConfiguration
{
public AccountMap()
Just implement the IEntityTypeConfiguration
public abstract class EntityTypeConfiguration : IEntityTypeConfiguration where TEntity : class
{
public abstract void Configure(EntityTypeBuilder builder);
}
and then add it to your entity Context
public class ProductContext : DbContext, IDbContext
{
public ProductContext(DbContextOptions options)
: base((DbContextOptions)options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfiguration(new ProductMap());
}
public DbSet Products { get; set; }
}