private static Expression GenerateIn(Expression operand, IEnumerable<Expression> args) { return Expression.Call(ContainsMethod.MakeGenericMethod(operand.Type), Expression.NewArrayInit(operand.Type, args.Select( x => x.Type == operand.Type ? x : Expression.Convert(x, operand.Type))), operand); }