Nhibernate + QueryOver: filter with Where ignoring sensitive

后端 未结 5 1224
一生所求
一生所求 2021-01-11 22:54

I am trying to build a simple query in nHibernate with QueryOver but I want it to convert everything lower-case or ignore sensitive:

Domain.User User = Sessi         


        
5条回答
  •  走了就别回头了
    2021-01-11 23:42

    my workaround for this is using a expression.eq combined with a projection, so a case insensitive equals without any magic strings can be done with queryover

    query.Where(Expression.Eq(Projections.Property(Of MyType)
                    (Function(x) x.Name), "something").IgnoreCase)
    

提交回复
热议问题