NotSupportedException: The method 'Join' is not supported.
Options
I create a little c# expression with a join statement on a CRM database. I received the error:
NotSupportedException: The method 'Join' is not supported.
is this a CRM related error? I get the same error whether it is an expression, statement or program
NotSupportedException: The method 'Join' is not supported.
is this a CRM related error? I get the same error whether it is an expression, statement or program
Comments
-
Probably WCF OData related.
Try using navigation properties if they exist or .AsEnumerable() to retrieve data sets separately and do the join locally.
The latter will result in a lot more requests, more data being transferred and potentially lack of results due to late filtering and paging.
Example navigation property:// http://services.odata.org/V3/Northwind/Northwind.svc from o in Orders select new { o.Customer.CompanyName, o.OrderDate }
Request log:http://services.odata.org/V3/Northwind/Northwind.svc/Orders()?$expand=Customer&$select=Customer/CompanyName,OrderDate
Example .AsEnumerable():// http://services.odata.org/V3/Northwind/Northwind.svc from o in Orders.AsEnumerable() join c in Customers.AsEnumerable() on o.CustomerID equals c.CustomerID select new { o.OrderDate, c.CompanyName }
Request log:http://services.odata.org/V3/Northwind/Northwind.svc/Customers
(due to max. 200 items fetched per request and no paging, the result is incomplete)
http://services.odata.org/V3/Northwind/Northwind.svc/Orders