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

OA supports all linq syntax ?

1 Answer 48 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.
BekirSami
Top achievements
Rank 1
BekirSami asked on 05 Jan 2011, 08:14 AM
Following linq works with LinqPad but with Open Access gives error.
var rows = from vp1 in Context.VehiclePositionHistories
          from v in Context.Vehicles
          where vp1.VehicleId == v.Id
          && vp1.Id ==
            (
                from vp2 in Context.VehiclePositionHistories
                where vp2.VehicleId == v.Id
                select vp2.Id
             ).Max()
          select vp1;

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 05 Jan 2011, 04:31 PM
Hi Hasan,

looks like an issue with this query. However, I was thinking if grouping wouldn't be more appropriate for your specific case as you wish to obtain the max() per vehicle.

I will have a look into that.

Best wishes,
Thomas
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
LINQ (LINQ specific questions)
Asked by
BekirSami
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or