public static ICriterion ProcessIsInCollection(MethodCallExpression methodCallExpression) { ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(methodCallExpression.Arguments[0]); ICollection values = (ICollection)ExpressionProcessor.FindValue(methodCallExpression.Arguments[1]); return(projection.Create <ICriterion>(s => Restrictions.In(s, values), p => Restrictions.In(p, values))); }
public static ICriterion ProcessIsLikeMatchMode(MethodCallExpression methodCallExpression) { ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(methodCallExpression.Arguments[0]); string value = (string)ExpressionProcessor.FindValue(methodCallExpression.Arguments[1]); MatchMode matchMode = (MatchMode)ExpressionProcessor.FindValue(methodCallExpression.Arguments[2]); return(projection.Create <ICriterion>(s => Restrictions.Like(s, value, matchMode), p => Restrictions.Like(p, value, matchMode))); }
public static ICriterion ProcessIsBetween(MethodCallExpression methodCallExpression) { MethodCallExpression betweenFunction = (MethodCallExpression)methodCallExpression.Object; ExpressionProcessor.ProjectionInfo projection = ExpressionProcessor.FindMemberProjection(betweenFunction.Arguments[0]); object lo = ExpressionProcessor.FindValue(betweenFunction.Arguments[1]); object hi = ExpressionProcessor.FindValue(methodCallExpression.Arguments[0]); return(projection.Create <ICriterion>(s => Restrictions.Between(s, lo, hi), p => Restrictions.Between(p, lo, hi))); }
public AbstractCriterion And(object hi) { AbstractCriterion criterion = projection.Create <AbstractCriterion>(s => Restrictions.Between(s, lo, hi), p => Restrictions.Between(p, lo, hi)); if (isNot) { return(Restrictions.Not(criterion)); } return(criterion); }
public TReturn And(object hi) { return(Add(projection.Create <ICriterion>(s => Restrictions.Between(s, lo, hi), p => Restrictions.Between(p, lo, hi)))); }
/// <summary> /// Apply an "in" constraint to the named property /// </summary> public TReturn IsIn(ICollection values) { return(Add(projection.Create <ICriterion>(s => Restrictions.In(s, values), p => Restrictions.In(p, values)))); }
/// <summary> /// Apply an "in" constraint to the named property /// </summary> public AbstractCriterion IsIn(ICollection values) { return(Process(projection.Create <AbstractCriterion>(s => Restrictions.In(s, values), p => Restrictions.In(p, values)))); }