This is a migrated thread and some comments may be shown as answers.

Max(IEnumerable`1,Func`2)' on the database server side currently not implemented

3 Answers 99 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Goran
Top achievements
Rank 1
Goran asked on 14 Mar 2012, 02:44 PM
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

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?

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 15 Mar 2012, 06:12 PM
Hello,

OpenAccess  will contain support for those kind of subqueries in the next build. Thanks for reporting this shortcoming, your Telerik Points have been updated.

All the best,
Thomas
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
0
Ian
Top achievements
Rank 1
answered on 20 Mar 2012, 04:41 PM
Is there a PITS number for this?
0
Ivailo
Telerik team
answered on 22 Mar 2012, 10:35 AM
Hello Vernon,

You can find the new PITS item here.

Regards,
Ivailo
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Tags
LINQ (LINQ specific questions)
Asked by
Goran
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Ian
Top achievements
Rank 1
Ivailo
Telerik team
Share this question
or