0
類我有3類:的EntityFramework InverseProperty與在中間
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的能力?