把sql语句转为Linq?
SELECT * FROM Emp_EmpProduce A WHERE EmpPro_Time = (SELECT TOP 1 EmpPro_Time FROM "); strWhere.Append(" Emp_EmpProduce WHERE Cus_ID = A.Cus_ID and Emp_IdentityCard=a.Emp_IdentityCard and Type_id=a.Type_id ORDER BY EmpPro_Time DESC) and Cus_ID={0} and Emp_IdentityCard='{1}' and IsLess=0,
请教各位高手如何把这句Sql语句转换为Linq语句。
from e in query where e.IsLess==0 && e.Type_Id==typeId && e.Emp_BllType==0 && e.EmpPro_Time ==(from c in query where c.Cus_ID == e.Cus_ID && c.Emp_IdentityCard == e.Emp_IdentityCard && c.Type_Id == e.Type_Id orderby c.EmpPro_Time descending select c.EmpPro_Time).First() select e ,报在 LINQ 表达式中检测到循环。
------解决方案--------------------自己先顶一下!