首页 > TAG信息列表 > NotMapped

EF codeFirst映射多出一个Discriminator列

我有一个EF类需要映射到数据库,然后有一个其他的类继承了这个类,使用code first便会出现该问题 解决方法:加上NotMapped public class A { [Key] public int Id { get; set; } } [NotMapped] public class B : A { public string Name { get