相关疑难解决方法(0)

Linq To Sql仅比较时间

如何在不获取以下内容的情况下仅比较DateTime对象的时间

错误:

An exception of type 'System.NotSupportedException' occurred in mscorlib.dll but was not handled in user code Additional information: The specified type member 'TimeOfDay' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
Run Code Online (Sandbox Code Playgroud)

我的代码:

var date = DateTime.Parse(query.DueTime);
entities = entities.Where(r => r.DueTime.TimeOfDay.Equals(date.TimeOfDay));
Run Code Online (Sandbox Code Playgroud)

c# sql linq

10
推荐指数
1
解决办法
7968
查看次数

标签 统计

c# ×1

linq ×1

sql ×1