多表多条件联合查询
现有2表2条件联合查询
var query = from o in _context.Orders
//join c in _context.Customers on o.CustomerId equals c.CustomerId
join c in _context.Customers
on new { o.CustomerId, o.FromPT }
equals new { c.CustomerId, c.FromPT }
into s
from oc in s.DefaultIfEmpty()
var query = from o in _context.Orders
join c in _context.Customers
on new { o.CustomerId, o.FromPT }
equals new { c.CustomerId, c.FromPT } into s
from oc in s.DefaultIfEmpty()
join risk in _context.OrderRiskLevel
on new { o.OrderId , o.FromPT }
equals new { risk.OrderId,risk.FromPT } into t
from risk in t.DefaultIfEmpty()
select o;