Page 1 of 1

OUTER APPLY WORKAROUND

Posted: Mon 19 Nov 2012 12:27
by JoeRuspante
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

Re: OUTER APPLY WORKAROUND

Posted: Fri 23 Nov 2012 13:05
by Shalex
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).