queryover and (x like 'a' or y like 'a')

前端 未结 3 786
离开以前
离开以前 2020-12-04 16:16

Hi Is there any elegant way of combining \'like\' and \'or\' when i\'m using queryover API? for \'like\' there is something like:

 query.WhereRestrictionOn(         


        
3条回答
  •  醉梦人生
    2020-12-04 16:56

    query.Where(Restrictions.On(x => x.Code).IsLike(codePart) ||
                Restrictions.On(x => x.Description).IsLike(codePart))
    

提交回复
热议问题