In EF6 we usually able to use this way to configure the Entity.
public class AccountMap : EntityTypeConfiguration
{
public AccountMap()
Am I right?
public class SmartModelBuilder where T : class {
private ModelBuilder _builder { get; set; }
private Action> _entityAction { get; set; }
public SmartModelBuilder(ModelBuilder builder, Action> entityAction)
{
this._builder = builder;
this._entityAction = entityAction;
this._builder.Entity(_entityAction);
}
}
I can Pass config:
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// Customize the ASP.NET Identity model and override the defaults if needed.
// For example, you can rename the ASP.NET Identity table names and more.
// Add your customizations after calling base.OnModelCreating(builder);
new SmartModelBuilder(builder, entity => entity.Property(b => b.Url).Required());
}