OUTER APPLY WORKAROUND

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
JoeRuspante
Posts: 54
Joined: Mon 05 Jul 2010 23:08

OUTER APPLY WORKAROUND

Post by JoeRuspante » Mon 19 Nov 2012 12:27

There is a workaround for use a LINQ that throws teh "OUTER APPLY NOT SUPPORTER BY ORACLE" exception?


I saw the workaround when I need only a field (ex: min(date)).
In my case I have an order with more details (1 to N relationship) and I need to have all the data of the first detail row (quantity, price, ...)

My LINQ query is this:

Code: Select all


var query = from o in MyContext.Orders
            let d = o.Details.OrderBy(x => x.Id).FirstOrDefault()
            select new OrderDTO
            {
                Id = o.Id,
                ProductId = d.ProductId,
                Price = d.Price
                Quantity = d.Quantity
            }


Thank you in advance

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: OUTER APPLY WORKAROUND

Post by Shalex » Fri 23 Nov 2012 13:05

Scenarios which lead to CROSS APPLY/OUTER APPLY are listed at http://forums.devart.com/viewtopic.php?t=23362. Maybe avoiding usage of OrderBy will help (but no guarantee).

Post Reply