LINQ给出错误:join子句中某个表达式的类型不正确

时间:2013-12-18 21:01:04

标签: linq

我的LINQ查询出现以下错误:

The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'GroupJoin'.

我有以下LINQ查询,它给出了错误:

from m in array join p in resellers on m equals p.ResellerId into j
//  join p in resellers on new { m }  equals new { p.ResellerId } into j

1 个答案:

答案 0 :(得分:-1)

我不知道array是什么类型,但是如果您遇到错误,它肯定与p.ResellerID的类型不同。这是它给你的类型推断错误。您需要使用m中与array相同类型的p.ResellerID属性才能正确进行加入。