title: How to initiate a var which will store array of values with different datatypes?
body: <p>I have a dynamic expression built in .net, which works if the column type is string, however, if the column is date or int then i have to convert the input to the respective datatype before passing to the expression. How can I make it dynamic?</p>
  <pre><code>    MemberExpression member = Expression.Property(param, filter.Name);
      var propertyType = ((PropertyInfo)member.Member).PropertyType;
      
      if (propertyType.GetType() == typeof(Int32))
      {
        var criteria = Array.ConvertAll(filter.Value, Int32.Parse);
      }
      else if (propertyType.GetType() == typeof(DateTime))
      {
        var criteria = Array.ConvertAll(filter.Value, DateTime.Parse);
      }
      else
      {
      var criteria = filter.Value;
      }
  
  criteria.Aggregate( // -- gives error here since criteria does not exist in current context
      (Expression)Expression.Constant(false),
          (acc, next) =&gt;
          Expression.MakeBinary(
          ExpressionType.Or,
          acc, Expression.Equal(member, Expression.Constant(next))));
  </code></pre>
  <p>I already tried defining</p>
  <pre><code>var criteria = null;
  var criteria = object[];
  dynamic criteria;
  var criteria = new {};
  </code></pre>
  <p>Payload</p>
  <pre><code>{
    &quot;pageFilters&quot;: [
      {
        &quot;name&quot;: &quot;string&quot;,
        &quot;condition&quot;: &quot;Equals&quot;,
        &quot;value&quot;: [
          &quot;string&quot;
        ]
      }
    ]
  }
  </code></pre>