LINQ中实现not in查询
来源:互联网 发布:体检 知乎 编辑:程序博客网 时间:2024/06/14 01:11
在实际项目中,经常会用到not in 的查询操作,下面介绍 LINQ中实现not in查询 的实例
from c in dc.Customerswhere !(from o in dc.Ordersselect o.CustomerID).Contains(c.CustomerID)select c;
var query = from c in _opvRepository.Table join a in _orderRepository.Table on c.OrderId equals a.Id join p in _pvRepository.Table on c.ProductVariantId equals p.Id join e in _productRepository.Table on p.ProductId equals e.Id where a.CustomerId == customerId & !(from s in _productReviewRepository.Table select s.ProductId).Contains(a.CustomerId & p.ProductId) select new CustomerChapter() { Name = p.Name, ProdcutName = e.Name, CreatedOn = a.CreatedOnUtc, ProductId = p.ProductId, Id = a.CustomerId, };
var queryResult = from p in db.Productswhere ! (new int[] {1,2}).Contains(p.CategoryID)select p;
文章转载自: LINQ中实现not in查询 http://www.studyofnet.com/news/1092.html
0 0
- LINQ中实现not in查询
- LINQ not in查询
- Linq not in 查询
- Linq 如何实现 in 与 not in
- Linq 如何实现 in 与 not in
- Linq如何实现int与not in?
- Linq to Entities 怎样实现"IN"查询
- Linq to Sql 如何实现 in 与 not in
- LINQ not in 写法
- Linq in 与 not in
- LINQ中如何使用SQL中NOT IN
- MySQL中,not in子查询
- 在数据查询中慎用 NOT IN
- Hive中实现in和not in
- Linq 实现 in 操作
- linq实现随机查询
- 关于LINQ中实现随机查询数据库中记录
- 关于LINQ中实现随机查询数据库中记录+
- Android UI性能优化 -- GPU过度绘制
- WebService:常用的API
- android的logcat过滤保存
- spring中@Autowired注解、@Resource注解的区别,以及@Qualifier的使用
- poj 2748 Logs Stacking 递推公式的循环节
- LINQ中实现not in查询
- Redis服务器搭建/配置/及Jedis客户端的使用方法
- C++标准转换运算符reinterpret_cast
- 在Unity项目中使用Git
- Spring Hello World 实例
- LeetCode---Search a 2D Matrix II
- SQL基础学习2
- eclipse中ant不能智能提示
- C#读写文件中文乱码