修改IList查询语句

时间:2018-09-28 07:25:32

标签: c# asp.net list linq-to-sql

我有以下语句,我想对其进行修改以不选择所有表。

  1. customerItemNo中排除2列manufacturerItemNoif,并且
  2. customerItemNoAppend中排除2列manufacturerItemNoAppendelse if

我该怎么办?

if (p.UserInternal == 'Y' && p.UserActive == 'Y')
    inventorySummary = DataProvider.SelectCondition<Q_TBL_INVENTORY_SUMMARY>
(r => r.InventoryLocationNo == location);

else if (p.UserInternal != 'Y' && p.UserActive == 'Y')
    inventorySummary = DataProvider.SelectCondition<Q_TBL_INVENTORY_SUMMARY>
(r => r.InventoryLocationNo == location && (r.CustomerID == customerID || r.CustomerID == " "));

else
    inventorySummary = new List<Q_TBL_INVENTORY_SUMMARY>();

0 个答案:

没有答案
相关问题