Nhibernate + QueryOver: filter with Where ignoring sensitive

后端 未结 5 1241
一生所求
一生所求 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:24

    NH 3.0 has a linq provider so you can use

    Session.Query()
               .Where(x=>x.Login.ToLower() =="username")
               .SingleOrDefault();
    

提交回复
热议问题