【发布时间】:2015-08-14 18:32:43
【问题描述】:
我有一个如下所述的模型:
public class Student
{
public int Id { get; set; }
public string Level { get; set; }
public string Subject { get; set; }
public string School { get; set; }
public int CityId { get; set; } //from City
}
public class City
{
public int Id { get; set; }
public string City { get; set; }
public int StateId { get; set; } //from State
}
public class State
{
public int Id { get; set; }
public string State { get; set; }
public int CountryId { get; set; } //from Country
}
public class Country
{
public int Id { get; set; }
public string Country { get; set; }
}
我想查询学生实体,需要将国家(仅限国家)包含到学生模型中。 数据库结构如上,我无法更改数据库表结构。
但我可以编辑上面的 EF 实体。最终我需要将国家作为学生实体的学生信息,这样我就可以绘制 jqGrid 并根据国家对它们进行排序。
【问题讨论】:
标签: c# mysql entity-framework jqgrid