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

Popular posts from this blog

SAP Web Service from .NET via WCF -

Optimized Line drawing in QT -

datetime - str to time in python -