Nhibernate Where Condition -
i want generate condition in nhibernate below can 1 me out
select id,name employee (id=@id or id null) want code generate condition.
you should check out documentation here: http://nhibernate.info/doc/nh/en/index.html#querycriteria-narrowing
a solution using criteria api is:
session.createcriteria<employee>() .add(restrictions.eq("id", id) | restrictions.isnull(id));
Comments
Post a Comment