【发布时间】:2011-10-22 12:46:57
【问题描述】:
为什么在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; }
}
【问题讨论】:
标签: c# asp.net object-relational-model