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
> orderStatusList = ...
> orderList = (from o in Scope.Extent<
orderby o.OrderID ascending
orderList = orderList.Where(o => orderStatusList.Contains(o.OrderEquipments.Max(e => e.OrderStatusID.Value)));
I tried changing the querry, but I get the same error also for functions Any
. 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?