c# ado.net eftity framework 返回多表查询结果

public static IQueryable GetWeiXinTuWenList()
{
using (var Model = new Model.WeiXinEntities())
{
var List = (from C in Model.MP_WeiXinSuCaiCategory
join TW in Model.MP_WeiXinTuWen on C.Id equals TW.CategoryId into rt
from TW in rt.DefaultIfEmpty()
where C.WeiXinID == Common.WeiXinID
select new { TW.Id, CategoryName = C.Name, TW.Title }).ToList();
return List.AsQueryable();
}
}

posted @ 2015-02-04 18:55  王鹏飛  阅读(1585)  评论(0编辑  收藏  举报