我有 3 节课:
public class User
{
...
public List<SerialHistory> SerialHistory { get; set;}
...
}
public class SerialHistory
{
...
public DateTime DateAdded { get; set; }
public SerialNumber SerialNumber { get; set; }
...
}
public class SerialNumber
{
...
public User User { get; set; }
...
}
我真的很喜欢这样,当我这样做时:
user.SerialHistory.Add(new SerialHistory {
SerialNumber = serialNumber,
DateAdded = DateTime.Now
});
会自动分配给它serialNumber.User
。user
这是可能的还是超出了 EntityFramework 的能力?