Nhibernate在何处条件
我想在nHibernate中生成一个where条件,如下所示,有人能帮我吗 从中选择Id、名称 受雇者 其中(id=@id或id为Null)Nhibernate在何处条件,nhibernate,Nhibernate,我想在nHibernate中生成一个where条件,如下所示,有人能帮我吗 从中选择Id、名称 受雇者 其中(id=@id或id为Null) 我希望代码生成where条件。您应该在此处查看文档: 使用API标准的解决方案是: session.CreateCriteria<Employee>() .Add(Restrictions.Eq("Id", id) | Restrictions.IsNull(id)); session.CreateCriteria() .Add(Re
我希望代码生成where条件。您应该在此处查看文档: 使用API标准的解决方案是:
session.CreateCriteria<Employee>()
.Add(Restrictions.Eq("Id", id) | Restrictions.IsNull(id));
session.CreateCriteria()
.Add(Restrictions.Eq(“Id”,Id)| Restrictions.IsNull(Id));
您应该在此处查看文档:
使用API标准的解决方案是:
session.CreateCriteria<Employee>()
.Add(Restrictions.Eq("Id", id) | Restrictions.IsNull(id));
session.CreateCriteria()
.Add(Restrictions.Eq(“Id”,Id)| Restrictions.IsNull(Id));