var list = from tab in context.Tbl_Section
                           where (new string[] { "d001", "d002" }).Contains(tab.DepartmentID) && !(new string[] { "S0142", "S0162" }).Contains(tab.SectionID)
                           && tab.UFlag == true
                           orderby tab.DepartmentID ascending
                           select tab;

第一个是实现in的功能 这个是判断数据中是否包含linq查询出来的值

第二个就比较明显了 加上一个!表示取反的功能就是 not in的功能了

相关文章:

  • 2021-10-27
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2021-11-11
  • 2021-12-14
相关资源
相似解决方案