开发者

nhibernate criteria, like on words

I want to do this with a nhibernate criteria:

SELECT Text FROM Table WHERE Text Like 'Re% Wi%'

The result should be:

Red Wine

I have the search parameter as a string 'Re Wi' from the user interface.

What is the best approach? split the string and put % at the end, join the string array and end up with:

开发者_C百科
criteria.Add(Restrictions.Like("Text", 'Re% Wi%', MatchMode.Start))

Or can I add the individual parts (beginning of words) to some criteria expression?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜