Linq to Sql First()不行

时间:2013-05-14 07:36:12

标签: sql linq lambda

这:

DbModal.SM_SYS_Globals.First(x => x.ObjectValue.Contains("To"))

有错误:

Expression cannot contain lambda expressions

1 个答案:

答案 0 :(得分:0)

请改用以下内容

DbModal.SM_SYS_Globals.Where(x => x.ObjectValue.Contains(“To”))。First()