类-U,FP,FP1和M
其中U是抽象类
FP是用户 FP1是FP
但是我应该能够同时创建FP和FP1 我应该能够得到所有FP和FP1
M具有FP或FP1,但不应同时为
我该怎么做?
public abstract class U
{
public int UId { get; set; }
public string Name { get; set; }
}
public class FP : U
{
public int FPId { get; set; }
}
public class FP1 : FP
{
public int FP1Id { get; set; }
}
public class M
{
public int Id { get; set; }
public FP1/FP FP1/FP { get; set; } //like this it should get what
should i do?
}
public class IsAHasADbContext : DbContext
{
public DbSet<FP> FPs { get; set; }
public DbSet<FP1> FP1s { get; set; }
public DbSet<FIL> FILs { get; set; }
public DbSet<M> Managaers { get; set; }
}