问题描述
什么是地狱意思?忽略的回报,而得到的,其结果将被夷为平地,并停留在应用MEM(所以这将是一个集...可能)
未能找到源类型System.Linq.IQueryable的查询模式的实现。加入未找到。考虑显式指定范围变量a的类型。的
What the hell does this mean? Ignore the return, and the get, The results will be flattened and stuck in the application mem (so this will be a set... probably)
"Could not find an implementation of the query pattern for source type 'System.Linq.IQueryable'. 'Join' not found. Consider explicitly specifying the type of the range variable 'a'."
private CommonDataResponse toCommonData
{
get
{
CommonDataResponse toCommonData = this.gatewayReference.GetCommonData();
Array dCountries = toCommonData.PropertyCountries.ToArray(); //Webservice sends KeyValuePairOfString
Array dRegions = toCommonData.Regions; //Webservice sends Array
Array dAreas = toCommonData.Areas; //Webservice sends Array
var commonRAR = from a in dAreas
join r in dRegions
on a.RegionID equals r.Id
join c in dCountries
on r.CountryCode equals c.Key
select new {c.Value, r.Name, a.Name, a.Id };
return toCommonData;
}
}
dRegions / dAreas两个数组,dCountries是.toArray()
dRegions/dAreas Both arrays, dCountries is .toArray()
推荐答案
阵列
是一个非常松散的类型,并且不执行的IEnumerable< T>
等,你可以尝试只切换阵列
行 VAR
(让编译器挑式)。如果仍然使用阵列
,那么也许使用 .Cast< T>()
指定类型(或 Array.ConvertAll
等)。
Array
is a very loose type, and doesn't implement IEnumerable<T>
etc. You could try just switching the Array
lines to var
(let the compiler pick the type). If it still uses Array
, then perhaps use .Cast<T>()
to specify the type (or Array.ConvertAll
, etc).
在阵列
(没有更多的信息),它只知道对象
。
From Array
(without more information) all it knows is object
.
基本上,加入
定义(作为一个扩展的方法)对的IEnumerable&LT; T&GT;
和的IQueryable&LT; T&GT;
- 不是的IEnumerable
(不包括&LT; T&GT;
)
Basically, Join
is defined (as an extension method) on IEnumerable<T>
and IQueryable<T>
- not IEnumerable
(without the <T>
).
这篇关于LINQ的错误&QUOT;未能找到源类型的查询模式的实现“System.Linq.IQueryable”加入未找到“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!