我有DateTime字段,其中存儲日期+時間。我只需要使用日期部分,所以我嘗試:DateTime和LinqToEntities
query = query.Where(p => p.CreatedDateTime.Date == DateStart);
,但我得到了以下錯誤:
The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
爲什麼和如何解決?