var query1 = from l in context.Logs
where l.LogID == maxid
select l;
int count1 = query1.Count();
var query2 = from ld in context.LogDetails
where ld.LogID == maxid
select ld;
int count2 = query2.Count();
Assert.AreEqual(1,count1);
Assert.AreEqual(0,count2);
I wish I could write the above query in a better way. If I were using TSQL, I could use OUTER JOIN and filter to see if ld.LogID was null. But I do not know how to do that in LINQ. Is there any way I could clean this up?
Thanks for helping out.
Outer joins are possible in LINQ.