Limitations nHibernate contains

I have an expression to evaluate as below

Restrictions.In (criteriaItem.PropertyName, criteriaItem.FilterValues);

Restrictions.Like (criteriaItem.PropertyName, criteriaItem.FilterValues);

I want Contains how to do this?

+3
source share
1 answer

string.Contains will display like in sql, just with the addition of wildcards. Try:

Restrictions.Like(criteriaItem.PropertyName,"%" + criteriaItem.ContainsValue + "%");
0
source

Source: https://habr.com/ru/post/1745156/


All Articles