8,497
社区成员
发帖
与我相关
我的任务
分享
return (from r in DataContext.PartInfo
where r.GoodsCode == goodsCode &&
r.ParentCode ==(string.IsNullOrEmpty(parentCode)?null: parentCode)
select r).Single();
var query=from c in this.Customers
where Nullable.Equals(c.Region,s==null?null:string.IsNullOrEmpty(s.Trim())?null:s)
select c;
SELECT [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax]
FROM [Customers] AS [t0]
WHERE [t0].[Region] IS NULL
return (from r in DataContext.PartInfo
where Nullable.Equals(r.ParentCode, parentCode) &&
r.GoodsCode == goodsCode select r).Single();
turn (from r in DataContext.PartInfo
where r.ParentCode.Equals(parentCode) &&
r.GoodsCode == goodsCode select r).Single();
return (from r in DataContext.PartInfo
where Nullable<decimal>.Equals(r.ParentCode, parentCode) &&
r.GoodsCode == goodsCode select r).Single();
PartInfo GetData(string parentCode, string goodsCode)
{
var query=from r in DataContext.PartInfo
where r.GoodsCode == goodsCode
select r;
if(string.IsNullOrEmpty(parentCode))
{
query=query.Where(r=>r.ParentCode == null);
}
else
{
query=query.Where(r=>r.ParentCode == parentCode);
}
return query.SingleOrDefault();
}