public static ICriteria WhereCaseInsensitiveContains <T>(this ICriteria criteria, Expression <Func <T, object> > expression, string value) { var criterion = Restrictions.InsensitiveLike(expression.ToPropertyName(), "%" + value + "%"); return(criteria.Add(criterion)); }
public static ICriteria WhereNotIn <T>(this ICriteria criteria, Expression <Func <T, object> > expression, DetachedCriteria subquery) { var propertyName = expression.ToPropertyName(); return(criteria.Add(Subqueries.PropertyNotIn(propertyName, subquery))); }
public static ICriteria WhereOnOrAfter <T>(this ICriteria criteria, Expression <Func <T, object> > expression, object value) { var propertyName = expression.ToPropertyName(); return(criteria.Add(Expression.Ge(propertyName, value))); }
public static ICriteria WhereIsNull <T>(this ICriteria criteria, Expression <Func <T, object> > expression) { var propertyName = expression.ToPropertyName(); return(criteria.Add(Restrictions.IsNull(propertyName))); }
public static ICriteria WhereEqualTo <T, U>(this ICriteria criteria, Expression <Func <T, U> > expression, U value) { var propertyName = expression.ToPropertyName(); return(criteria.Add(Expression.Eq(propertyName, value))); }
public static DetachedCriteria SetProjection <T>(this DetachedCriteria criteria, Expression <Func <T, object> > expression) { var propertyName = expression.ToPropertyName(); return(criteria.SetProjection(Projections.Property(propertyName))); }