c# - Like doesn't escape special characters NHibernate -
i have problem nhibernate linq contains
method, because want escape special characters in string example if type:
lel%lel
i want find
lel%lel not lel4325234534lel
to find values use following methods:
tabarray = _session.query<tab>() .where(x => x.attr.contains(query)) .toarray();
i try using likeexpression
didn't help.
i say, should (our code) not nhibernate. can use this:
how escape percentage sign in t-sql?
i.e. replace %
in c# [%]
lel[%]lel
and return expected
.where(x => x.attr.contains(query)) // query == "lel[%]lel"
Comments
Post a Comment