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?
精彩评论