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

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -