【发布时间】:2011-11-30 19:15:09
【问题描述】:
我使用 EF 4 和 C#。
我需要使用属于两个不同实体的两个属性来排序此查询的结果。
就我而言,我想通过gt.GroupTypeId 及其subset by cnt.ContentId 订购。
PS:我不确定我的标题是否合适,如果您认为不合适,请告诉我我会更改它:-)
from cnt in context.CmsContents
from gt in cnt.CmsGroupsTypes
join t in context.CmsTypes
on cnt.TypeContent equals t.TypeContent
join m in context.CmsModes
on cnt.ModeContent equals m.ModeContent
orderby gt.GroupTypeId // Problem here
select new
{
cnt.ContentId,
cnt.Title,
gt.TypeGroup,
gt.GroupTypeId,
TypeContentDescription = t.Description,
ModeContentDescription = m.Description,
cnt.IsPublished
};
【问题讨论】:
标签: c# entity-framework linq