One of the most frequently asked query type is outer join. With T-Sql by using ‘left outer join’ type it was possible to get the records of the Customer table without the orders.

T-Sql usage:

select c.ContactName, OrderID= case when o.OrderID is null then ‘(no orders)’ else convert(varchar,o.OrderID) end
from Customers c
left outer join Orders o on o.CustomerID = c.CustomerID

With Linq type instead of “outer” sentence, “DefaultIfEmpty()” method is used to get “left outer join”.

The usage of the T-Sql query above in Linq type:
(more…)

Powered by Mucitsoft