linq 类似左连接
以Employes 为主表,Orders 表可有可无,只要Employes 表有数据就可以查到
var q=from e in db.Employes
join o in db.Orders on e equals o.Emoloyee into ords
from on in ords.DefautIfEmpty()
select new
{
e.FirstName,
e.LastName
};
以Employes 为主表,Orders 表可有可无,只要Employes 表有数据就可以查到
var q=from e in db.Employes
join o in db.Orders on e equals o.Emoloyee into ords
from on in ords.DefautIfEmpty()
select new
{
e.FirstName,
e.LastName
};