TimeSpan time24 = new TimeSpan(24, 0, 0);
TimeSpan time18 = new TimeSpan(18, 0, 0);
// first get today's sleeping hours
List<Model.Sleep> sleeps = context.Sleeps.Where(
o => (clientDateTime - o.ClientDateTimeStamp < time24) &&
o.ClientDateTimeStamp.TimeOfDay > time18 &&
clientDateTime.TimeOfDay < time18 &&
o.UserID == userid).ToList();
biểu LINQ này ném ngoại lệ này:luận DbArithmeticExpression phải có một loại phổ biến số
DbArithmeticExpression arguments must have a numeric common type.
Xin vui lòng giúp!
Kết quả của 'clientDateTime - o.ClientDateTimeStamp' là gì? – shahkalpesh
noramlly phải là một đối tượng của TimeSpan, trong ngoại lệ EF được ném. –