相关疑难解决方法(0)

LINQ to SQL左外连接

此查询是否等同于LEFT OUTER连接?

//assuming that I have a parameter named 'invoiceId' of type int
from c in SupportCases
let invoice = c.Invoices.FirstOrDefault(i=> i.Id == invoiceId)
where (invoiceId == 0 || invoice != null)    
select new 
{
      Id = c.Id
      , InvoiceId = invoice == null ? 0 : invoice.Id
}
Run Code Online (Sandbox Code Playgroud)

.net linq database linq-to-sql

135
推荐指数
4
解决办法
14万
查看次数

标签 统计

.net ×1

database ×1

linq ×1

linq-to-sql ×1