model.ListManagerReviewerMapping = (from a in wallet.OM_Employee
join m in wallet.APPR_ManagerMapping
on a.AssociateId equals m.AssociateId
where m.ManagerId==Context.UserId.Value **into** MM
from leftjoinresult in M.DefaultIfEmpty()
where a.CompanyId == Context.CompanyId && (a.TermStatus == "L" || a.SeparationDate > DateTime.Today)
select new ManagerAndReviewerMappingModel.ManagerAndReviewerMapping()
{
Photo = (photoUrl + "?AssociateCode=" + a.AssociateCode),
AssociateId = a.AssociateId,
AssociateCode = a.AssociateCode,
AssociateName = a.AssociateName
}).ToList();
0
A
回答
1
您需要使用Where
扩展方法的第一个查询,如查询使用左连接与DefaultIfEmpty
(完注意,您可以” T选用into
后where
条款,因为where
必须遵循与select
完成查询):
model.ListManagerReviewerMapping = (from a in wallet.OM_Employee
join m in wallet.APPR_ManagerMapping.Where(x => x.ManagerId == Context.UserId.Value)
on a.AssociateId equals m.AssociateId into MM
from leftjoinresult in MM.DefaultIfEmpty()
where a.CompanyId == Context.CompanyId && (a.TermStatus == "L" || a.SeparationDate > DateTime.Today)
select new ManagerAndReviewerMappingModel.ManagerAndReviewerMapping()
{
Photo = (photoUrl + "?AssociateCode=" + a.AssociateCode),
AssociateId = a.AssociateId,
AssociateCode = a.AssociateCode,
AssociateName = a.AssociateName
}).ToList();
类似的问题:
+0
谢谢你为我工作 –
1
//Remove brackets and .ToList();
model.ListManagerReviewerMapping = from a in wallet.OM_Employee
join m in wallet.APPR_ManagerMapping
on a.AssociateId equals m.AssociateId
where m.ManagerId==Context.UserId.Value **into** MM
from leftjoinresult in M.DefaultIfEmpty()
where a.CompanyId == Context.CompanyId && (a.TermStatus == "L" || a.SeparationDate > DateTime.Today)
select new ManagerAndReviewerMappingModel.ManagerAndReviewerMapping()
{
Photo = (photoUrl + "?AssociateCode=" + a.AssociateCode),
AssociateId = a.AssociateId,
AssociateCode = a.AssociateCode,
AssociateName = a.AssociateName
};
相关问题
- 1. 查询体必须与SELECT子句或使用拉姆达在LINQ查询一组子句末表现
- 2. 查询体必须与选择子句或一组子句结束...的DataGridView
- 3. 又一个“查询正文必须以select子句或group子句结尾”
- 4. 复杂linq查询中的where子句给出以下错误“查询正文必须以select子句或子组linq结尾”
- 5. SELECT语句中的条件子查询
- 6. 对象必须实现IConvertible LINQ实体查询包含分组
- 7. LINQ查询与子where子句
- 8. 组合查询中的SELECT INTO子句
- 9. 子查询与多个SELECT语句
- 10. 子查询的SELECT语句与Knex.js
- 11. 错误与子查询Select语句
- 12. 子查询,而与多个SELECT语句
- 13. C#实体框架 - LINQ与实体查询子查询
- 14. 查询输入必须包含至少一个表或查询
- 15. 动态LINQ查询在LINQ到实体,与WHERE子句
- 16. Linq查询与group by子句
- 17. LINQ查询与除WHERE子句
- 18. Linq查询与分组和独特的嵌套select语句
- 19. Linq查询使用条款和最大
- 20. EJB3查询+条款
- 21. LINQ到实体组由子查询
- 22. MySQL查询条件或子查询
- 23. select查询语句
- 24. 重构的LINQ to SQL /实体与许多子查询查询
- 25. 将SQL查询与2个子查询合并在一起where条款
- 26. SQL查询与条件在where子句
- 27. 子查询计数() - 列必须出现在GROUP BY子句
- 28. select子句中的MySQL子查询
- 29. 查询必须以SELECT或FROM开头:delete [删除
- 30. Linq子分组查询
请以可读的方式格式化你的代码。提示:缩进4个空格。实际上问题或问题是什么? –
问题或问题是什么? –
** into **从查询体中获取错误必须以LINQ查询中的select子句或group子句结束 –