结构如下:
代码如下:
public IQueryable<PageTemplate> GetTemplate()
{
var PageTemplates = from oPT in _db.PageTemplates
join oHSFK in _db.HelperSites on oPT.SiteID equals oHSFK.SiteID into oHSChild
from oHS in oHSChild.DefaultIfEmpty()
join oHUFK in _db.HelperUsers on oPT.SiteID equals oHUFK.UserID into oHUChild
from oHU in oHUChild.DefaultIfEmpty()
where oPT.SiteID == ConfigDto.SiteDetails.SiteID || oPT.SiteID == null
select new
{
TemplateID = oPT.TemplateID,
TemplateName = oPT.TemplateName,
//SiteName = oHS.SiteName,
//UpdatedByName = oHU.UserFirstName + " " + oHU.UserLastName,
UpdatedDate = oPT.UpdatedDate
};
return null;
}
我怎么回去 IQueryable<PageTemplate>
已经有相关实体了。我知道创建一个具有 PageTemplate
, HelperSite
& HelperUser
班级。但是,我正在寻找一个解决方案,如果可能的话,使用现有的实体框架类。
暂无答案!
目前还没有任何答案,快来回答吧!