public static BinaryExpression GetBinaryExpression(SemanticVersion left, ComparatorSet right) { if (right.Count() == 0) { return(GetBinaryExpression(ExpressionType.Equal, left, left)); } else { BinaryExpression c = null; foreach (Comparator r in right) { if (c == null) { c = GetBinaryExpression(r.Operator, left, r.Version); } else { c = Expression.AndAlso(c, GetBinaryExpression(r.Operator, left, r.Version)); } } return(c); } }
public static bool Satisfies(SemanticVersion v, ComparatorSet s) { return(InvokeBinaryExpression(GetBinaryExpression(v, s))); }