c# - 如何在 LINQ - SQL 中选择 Null
问题描述
我有使用T-SQL query
,我正在尝试将其重写为Linq
.
这是 T-SQL 查询
Select NULL
From Users U
inner join Porducts P on U.ProductId=P.ProductId
Where U.CreatedDate >= '2021-01-01'
这是我的 LINQ 查询
var queryResult= from u in _context.Users
join p in _context.Products on u.ProductId equals p.ProductId
where u.CreatedDate >= new DateTime(2021,01,01)
select (???);
我不知道如何select null
在 LINQ 的select
部分中编写。
解决方案
推荐阅读
- javascript - 尝试在 Typescript 中创建 Dictionary 对象时出错
- python-3.x - 对 numpy 数组使用多进程或多线程
- gitlab - Jenkins 管道:结帐不保留 Git 时间戳
- scala - Scala中的通用递归类型
- python - 将所有 tkinter GUI 保存为 PDF
- reactjs - 在过滤函数 React 中使用对象数组时获取一个空数组
- sql - 如何使用 postgreSQL 产生循环移位
- java - 通过从 Repository 方法返回 Page<> 生成的计数查询在 org.hibernate.QueryException 上崩溃:意外字符:'`'
- react-native - 从 react native/axios 发送图像
- loopbackjs - 在 LoopBack 4 中拦截服务/数据源