In EF6 we usually able to use this way to configure the Entity.
public class AccountMap : EntityTypeConfiguration<Account>
{
public AccountMap()
{
ToTable("Account");
HasKey(a => a.Id);
Property(a => a.Username).HasMaxLength(50);
Property(a => a.Email).HasMaxLength(255);
Property(a => a.Name).HasMaxLength(255);
}
}
How we can do in EF Core, since when the class I Inherit EntityTypeConfiguration that unable to find the class.
I download the EF Core raw source code from the GitHub, I can't find it.
Can someone help on this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…