Microsoft provides example like the one I have copied below for creating multiple conditions for a QueryExpression. Is there way to structure a QueryExpression so that you could dynamically handle a unknown number of conditions? In Microsofts example below they use condition1, condition2 and so on... Again I'm wondering if there's a way to create a more reusable QueryExpression that can handle a variable number of conditions. I know the whole thing could be done in LINQ but I'm specifically trying to determine if it could be done with QueryExpression.
// Create the query expression and set the entity to contact.
QueryExpression query = new QueryExpression();
query.EntityName = "contact";
// Create a condition where the first name equals Joe.
ConditionExpression condition1 = new ConditionExpression();
condition1.AttributeName = "firstname";
condition1.Operator = ConditionOperator.Equal;
condition1.Values = new string[] { "Joe" };
// Create another condition where the first name equals John.
ConditionExpression condition2 = new ConditionExpression();
condition2 .AttributeName = "firstname";
condition2 .Operator = ConditionOperator.Equal;
condition2 .Values = new string[] { "John" };