We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问 模型是否支持继承,例如 company->list abstract employee 下面有2种类型 manager, worker,
The text was updated successfully, but these errors were encountered:
在6.4.7中我测试可以支持EF的TPT模式,也就是Company建表子表外键指向Company分别建立Manager和Worker,只需要在基类指定下Table的名称,并且在子类也指定Table名称就可以实现继承关系,然后DataContext分别构建DbSet。 如果只是抽象类而不需要建表的的话,指定Table一致或者不填写的话应该默认采用TPH模式,子类和父类在同一张表,可以参考看看FrameworkUser的实现过程
[Table("SpaceBasics")] public class SpaceBasic : BasePoco { [Display(Name = "名称")] public string Name { get; set; } } [Table("Seats")] public class Seat : SpaceBasic { }
public DbSet<SpaceBasic> SpaceBasics { get; set; } public DbSet<Seat> Seats { get; set; } public DbSet<Area> Areas { get; set; }
Sorry, something went wrong.
No branches or pull requests
请问 模型是否支持继承,例如 company->list abstract employee 下面有2种类型 manager, worker,
The text was updated successfully, but these errors were encountered: