我有一个可以为空的 DateTime 字段的表:
CREATE TABLE [dbo].[myTable](
[ID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
...
[FinishedDate] [datetime] NULL,
etc...
当我尝试这个时:
var activeThings = from foo in _context.myTable
where foo.FinishedDate == null
select foo;
foreach ( var thing in activeThings ) {
... do some stuff ...
}
我没有得到任何价值。我怎样才能过滤这个空值?