var calls = _session.Query<CallTable>()
.Where(x => x.Rated == (short)0)
.ToList();
This sql is being generated:
select <....>
from [CallTable] cdrcalltmp0_
where cdrcalltmp0_.ClientId = 526 /* @p0 */
and cast(cdrcalltmp0_.Rated as INT) = 0 /* @p1 */
额定值是数据库中的一个 smallint。为什么要将 smallint 转换为 int 以便与 short 进行比较?