views:

1471

answers:

1

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 Both arrays, dCountries is .toArray()

+1  A: 

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.

Basically, Join is defined (as an extension method) on IEnumerable<T> and IQueryable<T> - not IEnumerable (without the <T>).

Marc Gravell
a.RegionID and r.Id type intr.CountryCode and c.Key type string
Chris M
should of been RegionId not RegionIDOh and changed the Arrays to Var ;o) Thanks
Chris M