使用Id的外键引用与使用object的外键引用有什么区别?例如:使用Id的FK关系 class Product public int Id { get; set; }
public string Name { get; set; }public string PhoneNumber { get; set; }
然后,我们倾向于为School模型编写以下内容:{ public virtual ICollection<Student> Students { get; set; }对于Student模型:{ public virtual School School { get; set; }因此,您可以看到,在School