See the comments plz. from c in Customers where c.CustomerID.StartsWith("P") join o in Orders on c.CustomerID equals o.CustomerID into sr from x in sr.DefaultIfEmpty() select new { CustomerID= c.CustomerID, OrderID = x == null ? -1 : x.OrderID, // This is OK. I thought this is the only way to safely access OrderID. Test = (int?)x.OrderID // But this works too. How does this work ok when x is null? }
Read More...