I need to get list of order headers which contain product with id 1.
In Sql I can write
SELECT *
FROM Orders
WHERE OrderID in (SELECT OrderID FROM OrderDetails WHERE ProductID=1);
How to convert this to DbLinq ?
Test below which fails in DbLinq.
In new engine: S0548: Can't analyze Contains() method
In old engine: NRE
Andrus.
[Description("Subquery with nested query")]
[Test]
public void CQ5_SubqueryNestedQuery()
{
var db = CreateDB();
var q = from d in db.Orders
where (from r in db.OrderDetails
where r.ProductID == 1
select
r.OrderID).Contains(d.OrderID)
select d;
var count = q.ToList().Count;
Assert.AreEqual(count,1 );
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---