【发布时间】:2024-05-01 16:35:02
【问题描述】:
是的,我知道在 * 中有很多关于这个主题的问题开放和回答,但没有一个解决我的问题。
我正在尝试比较 QueryOver 的 where 子句中的两个字符串,但出现错误“从范围 '' 引用的 '' 类型的变量 '',但未定义”。我不知道我做错了什么,也没有找到适合我的案例的例子。谁能帮帮我?
这是我的代码:
var queryOverPaciente = _session.QueryOver(() => pacienteAlias).
Where(() => pacienteAlias.DataCadastro.Value.IsBetween(dataInicio).And(dataFinal));
// Other things....
// the error occurs here. "Identificacao" and "MatriculaInicio" are strings
// and I want to select all registers that "Identificacao" >= "MatriculaInicio".
queryOverPaciente = queryOverPaciente.Where(p =>
p.Identificacao.CompareTo(filtroRelatorio.MatriculaInicio) >= 0);
【问题讨论】:
标签: c# nhibernate linq-to-nhibernate queryover