This question is locked. New answers and comments are not allowed.
I have an Order and OrderEquipment. Order has more OrderEquipments with different OrderStatuses.
orderStatusList contains the list of (int) IDs of an OrderStatus according to which I want to filter my results. (I want to get the Order which maximum status of its OrderEquipments is in orderStatusList)
When I run this code I get an error:
Execution of 'System.Linq.Enumerable:Max(IEnumerable`1,Func`2)' on the database server side currently not implemented
I tried changing the querry, but I get the same error also for functions Any or All. also, I tried with subqueries but then I get an error that the second Select is not implemented/supported
Do you know maybe why is this happening?
orderStatusList contains the list of (int) IDs of an OrderStatus according to which I want to filter my results. (I want to get the Order which maximum status of its OrderEquipments is in orderStatusList)
When I run this code I get an error:
Execution of 'System.Linq.Enumerable:Max(IEnumerable`1,Func`2)' on the database server side currently not implemented
List<
int
> orderStatusList = ...
IQueryable<
Order
> orderList = (from o in Scope.Extent<
Order
>()
orderby o.OrderID ascending
select o);
orderList = orderList.Where(o => orderStatusList.Contains(o.OrderEquipments.Max(e => e.OrderStatusID.Value)));
return orderList.ToList();
I tried changing the querry, but I get the same error also for functions Any or All. also, I tried with subqueries but then I get an error that the second Select is not implemented/supported
Do you know maybe why is this happening?