Nhibernate + QueryOver: filter with Where ignoring sensitive

后端 未结 5 1334
一生所求
一生所求 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条回答
  •  Happy的楠姐
    2021-01-11 23:26

    In QueryOver you can use following:

    Domain.User User = Session.QueryOver()
           .WhereRestrictionOn(x=>x.Login).IsInsensitiveLike("username")
           .SingleOrDefault();
    

提交回复
热议问题