为什么在 ORM(对象关系模型)模型中,图书类中的外键列发布者是一类发布者,而我们可以使用长类型(在数据库中发布者是外键和 Bigint)?
public class Publisher
{
[XmlAttribute]
public string Title { get; set; }
[XmlAttribute]
public string Address { get; set; }
}
public class Book
{
[XmlElement]
public Publisher Publisher { get; set; } ******
[XmlAttribute]
public string Title { get; set; }
[XmlAttribute]
public short PrintYear { get; set; }
[XmlAttribute]
public short Pages { get; set; }
[XmlAttribute]
public string ISBN { get; set; }
}