OUTER APPLY WORKAROUND

OUTER APPLY WORKAROUND

Postby 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
JoeRuspante
 
Posts: 54
Joined: Mon 05 Jul 2010 23:08

Re: OUTER APPLY WORKAROUND

Postby 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).
Shalex
Devart Team
 
Posts: 7709
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle