C# EF+LINQ 查询主表明细表数据查询条件写法
C# 全选
//主从表的统一查询内容
if (!input.content.IsEmpty())
{
//查询明细(子查询)
var q_Sub = q_APs.Where(w => false
|| w.InvoiceNo == input.content
|| w.InvoiceName == input.content
|| w.OrderNo == input.content
|| (w.Remark ?? "").Contains(input.content));
//主表
q_AP = q_AP.Where(w => (false
|| w.APNO == input.content
|| w.SupplierCode == input.content
|| (w.SupplierName ?? "").Contains(input.content)) || q_Sub.Any(x => x.APNO == w.APNO));
}
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网