我有一个特定的linq to entity查询,其编写如下:
var query = from orgs
in orgBaseQuery.Where(org => org.LastUpdated >= fromDate
&& org.LastUpdated <= toDate)
toDate
和fromDate
的类型是.net DateTime
,LastUpdated
的类型是SQL DateTime
。我的问题是生成的SQL查询中没有毫秒部分,这导致我们的应用程序出现一些错误。我想知道在没有将LastUpdated
的数据类型更改为datetime2
的情况下是否有任何此问题的解决方案?