Best approach to add a case in a column for nhibernate -


what best way add query projection in nhibernate? case when account.firstname = '' , account.lastname = '' email.emailaddress else account.firstname + ' ' + account.lastname end

should this:

var accounts = session.queryover<account>()   .select(projections.conditional(restrictions.and(             restrictions.eq("firstname", ""),             restrictions.eq("lastname", "")),               projections.concat(p.lastname, ", ", p.firstname),               projections.property(t => t.emailaddress)))   .list(); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -