【发布时间】:2014-07-31 10:16:01
【问题描述】:
我知道如何使用Disjunction() 添加 OR 限制,但我需要添加到这组标准中,而且我总是需要至少 2 个标准。我想知道如何将单个 OR 添加到现有条件。
半代码示例。
model.RootCriteria.Add(restriction)
接下来几行我想根据变量添加 AND 或 OR 限制到已经存在的变量。
if(AND)
model.(Here add AND restriction)
else if(OR)
model.(Here add OR restriction) 我不知道如何这样做
我想要接收的输出是:
Where name like 'name ' (AND or OR) second restriction;
【问题讨论】:
标签: c# sql hibernate nhibernate queryover