我有以下sql语句:
Select * from table where (Field1=1 and Field2=1) or (Field3=1)如何使用NHibernate ICriteria Keld创建选区
发布于 2011-11-02 21:51:03
使用Restrictions.Or和Restrictions.And
Session
.CreateCriteria<Table>()
.Add(Restrictions.Or(
Restrictions.And(
Restrictions.Eq("Field1", 1),
Restrictions.Eq("Field2", 1)),
Restrictions.Eq("Field3", 1))
.List<Table>();https://stackoverflow.com/questions/7981310
复制相似问题