Can I use SQL functions in NHibernate QueryOver? -


i have been searching internet , can't find example on how use queryover of nhibernate 3.0 example use string functions on clause of queryover ex:

var item = query.where(x => x.name.tolower() == name.tolower()).firstordefault(); 

but doesn't work, because nhibernate can't understand tolower, how can extend dialect in way becomes possible?

session.queryover<foo>()     .where(restrictions.eq(         projections.sqlfunction("lower", nhibernateutil.string,              projections.property<foo>(x => x.name)),         name.tolower())) 

should sql where lower(name) = @p0


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -