c# - 从 ThenInclude 中排除空值
问题描述
我的EF上下文如下
_context.Offices
.Where( x => x.ID == id )
.Include( x => x.County)
.ThenInclude( x => x.Employees)
.ThenInclude( s => s.Department)
.ThenInclude( m => m.DeptUser )
.Include( x => x.XYZ);
我的问题是 DeptUser 可以为空。如何排除空项目?
解决方案
推荐阅读
- c# - Overloading an api endpoint
- javascript - react-select CreateableSelect 组件不维护状态值
- jquery - Asp.Net Razor 页面 DataTabels.net Jquery 延迟加载数据 vom 数据库
- javascript - 如何访问函数 args
- c++ - OpenGL 应用程序控制台未关闭
- javascript - 'this' 关键字对 JavaScript (NodeJS) 中的箭头和普通函数的影响,其中函数未在类/对象中定义
- c# - Directory.EnumerateDirectories :只取回包含特殊文件的目录
- python - Python:什么时候多线程,什么时候循环?
- python - 比较 OpenCV 中的两个简笔画
- python - 与 urllib3 袜子导入相关的 yahoo_fin 问题?