Entity Framework 中的in操作实例
2024-10-19 04:31:35
var listimportDataEOIResoults = importDataEOIResoults.Select(i => i.ProductSelectionId).ToList();
var productSelections =
_efWorker.ProductSelectionRepository.FindAll(
filter: ps => listimportDataEOIResoults.Contains(ps.Id));
需要注意的是不能这样写:
var productSelections =
_efWorker.ProductSelectionRepository.FindAll(
filter: ps => importDataEOIResoults.Select(i => i.ProductSelectionId).ToList().Contains(ps.Id));
需要先提取出具体的list才能在EF中使用Contains(也就是In操作)
最新文章
- HTTP Status
- 【13_263】Ugly Number
- ListView实现Item上下拖动交换位置 并且实现下拉刷新 上拉加载更多
- Hadoop第12周练习—HBase安装部署
- docker gitlab,redmine,etc development enviroments
- BMS 项目过程中遇到的问题
- C#复习,输入学生信息排列成绩
- COS访谈第十八期:陈天奇
- Python网络编程——主机字节序和网络字节序之间的相互转换
- bzoj:1654 [Usaco2006 Jan]The Cow Prom 奶牛舞会
- Android Studio 插件开发详解四:填坑
- 第30月第13天 supportedInterfaceOrientationsForWindow旋转
- html的空格和换行显示
- 【Checkio Exercise】Three Point Circle
- Lexicography
- easyui的datagrid
- POJ - 1101 The Game dfs
- 遍历 SortedList<;string, string>; 中的值(可用于datatable转json)
- 第216天:Angular---自定义指令(二)
- NOIP赛前集训营-提高组(第一场)#B 数数字
热门文章
- 分享录制的正则表达式入门、高阶以及使用 .NET 实现网络爬虫视频教程
- layer弹窗监控键盘事件
- deepin 15.3添加PPA源 安装php5.6
- asp.net form身份认证不定时认证失败的问题 排查
- rails
- PC工作原理
- 11月1日上午PHP------empty、 is_null、isset、unset的区别
- lucene大索引文件分布式存储方案
- Activiti学习(一) 环境搭建
- 微信服务号模板消息接口新增";设置行业";和";添加模板";及细节优化