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();
이 Linq 표현식은 다음 예외를 발생시킵니다.
DbArithmeticExpression arguments must have a numeric common type.
도와주세요!
일반적으로 TimeSpan의 개체 여야하는 EF 예외가 throw됩니다.
—
Nawaz Dhandala 2010 년
clientDateTime - o.ClientDateTimeStamp무엇입니까?