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
Post a Comment