In the code below, I'm wondering why the elements resulting from my left outer join (as in from d in co.DefaultIfEmpty(emptyOrder) where d is the elements of the table returned from co.DefaultIfEmpty(emptyOrder)) don't contain properties from both Customers and Orders, but rather only contains properties from Orders. I find myself having use two variables to display the required information, c.c and c.d, to be able to access information from Customers and Orders. If I replace c.c.CompanyName by c.d.CompanyName, the compiler says CompanyName is not a property of c.d, which is an Order. What I don't understand is this: isn't d supposed to be an element of the resulting table from joining Customers and Orders? Why then doesn't d contain properties from both Customers and Orders as in SQL where the resulting joined table would display columns from Customers and Orders all into one table?
var query11 = from c in CustomerList
where c.Country == "USA"
join o in OrderList
on c.CustomerID equals o.CustomerID into co
from d in co.DefaultIfEmpty(emptyOrder)
select new { c, d };
foreach (var c in query11) {
sbResult.Append(String.Format("CustID = {0}, Name = {1},
OrderID = {2}, OrderDate = {3:d}\r\n",
c.c.CustomerID, c.c.CompanyName, c.d.OrderID,
c.d.OrderDate));
}