简体   繁体   中英

NHibernate Linq Like Query Question

Is there any way to make NHibernate.Linq generate a like query on an integer field? The SQL that I want it to generate is:

select IntegerColumn 
from Table 
where IntegerColumn like '%StringValue%'

I've tried something like:

from entity in _session.Linq<Entity>
where entity.IntegerColumn.ToString().Contains(StringValue)
select entiry.IntegerColumn

This produces an ArgumentOutOfRange exception when it evaluates the query.

Does anyone have an idea how I can accomplish this?

Thanks, Nathan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM