此语句在 Entity Framework 中不起作用
context.sleep.Where(o=>o.clientDateTime.TimeOfDay>new TimeSpan(18,0,0)).ToList();
请建议我一个解决方法。
异常消息:
The specified type member 'TimeOfDay' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
最佳答案
解决方法是使用这个:
WHere(o=>o.clientDateTime.Hour >= 18)
关于c# - : context. sleep.Where(o=>o.clientDateTime.TimeOfDay>new TimeSpan(18,0,0)).ToList(); 的任何解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9820965/