【发布时间】:2013-06-21 09:12:31
【问题描述】:
我在 EF 中有一对一的关系。
public partial class ttQuestion
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long ID { get; set; }
public Nullable<long> CategoryID { get; set; }
[ForeignKey("CategoryID")]
public virtual ttCategory ttCategory { get; set; }
}
public partial class ttCategory
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long ID { get; set; }
}
我想用微风.js 查询它,但 ttCategory 没有序列化为 json。我想我把钥匙设置错了?我还尝试将 ttCategory.ID 设置为 ForeignKey,但没有成功。
【问题讨论】:
标签: c# entity-framework serialization breeze