我有一个类似下面的会员模块(我简化了它)
public class User
{
public int Id { get; set;}
public int UserDetailId {get; set;}
public virtual UserDetail UserDetail {get; set;}
}
public class UserDetail
{
public int Id {get; set;}
public int UserId {get; set;}
public string UserName {get; set;}
public string PassWord {get; set;}
public virtual User User {get; set;}
}
然后我在许多项目中使用这种结构,但有一些改进,如下所示
public class CustomUser : User
{
public string FirstName {get; set;}
public string LastName {get; set;}
public string EMail {get; set;}
}
CustomUser 和 UserDetail 之间的关系应该是一对一的,并且 Discrimininator 字段应该被丢弃。我正在使用流利的api。但我无法成功。