Repository.Calls
.Count(call => call.OutcomeActionDate.Value >= fourWeeksStartDate &&
call.OutcomeActionDate.Value < threeWeeksStartDate &&
call.UserId == user.UserId);
上面的查询给了我输出 1 和 sql 查询:
select *
from calls
where userid = 1006 and
outcomeactiondate >= '2013-08-19' and
OutcomeActionDate < '2013-08-26'
给我输出15。
输出 15 是正确的。我不确定为什么 linq 查询给了我不正确的值?select 查询中使用的所有参数值与 linq 查询中传递的参数值相同。