Nhibernate Queryover Case Insensitive IsIn

I have this sample code ...

Result = session.QueryOver<Lfee_Exc>().WhereRestrictionOn(x => x.FirstName)
.IsIn(ListOfFirstNames).List();

Is there a way to make this case insenstive or uppercase x.ArNumber for my case-sensitive Oracle server?

+5
source share
1 answer

Convert ListOfFirstNames to upercase, and then:

session.QueryOver<Lfee_Exc>()
    .Where(Restrictions.In(Projections.SqlFunction(
                              "upper", NHibernateUtil.String,
                               Projections.Property<Lfee_Exc>(x => x.FirstName)),
                           ListOfFirstNames))
+9
source

All Articles