I need to basically pass a list of objects each has 3 parameters variable name, operator, and value.
I have tried using
public async Task<ActionResult> GetAPIData([FromQuery] Condition[] conditions) 
where condition is
public class Condition
{
    public string variable { get; set; }
    public string op { get; set; }
    public double value { get; set; }
}
but I just can't get it to pass the items across every time I call the API "conditions" is empty.
It's a messy URL but swagger gives me
http://localhost:5001/api/datatable?conditions=%7B%0A%20%20%22variable%22%3A%20%22vara%22%2C%0A%20%20%22op%22%3A%20%22%3E%22%2C%0A%20%20%22value%22%3A%2020%0A%7D&conditions=%7B%0A%20%20%22variable%22%3A%20%22varb%22%2C%0A%20%20%22op%22%3A%20%22%3E%22%2C%0A%20%20%22value%22%3A%2010%0A%7D
var t = conditions.Length;
IQueryable<ScreenerData> query = _context.datatable;
foreach (var condition in conditions)
{
    string variable = condition.variable;
    string _operator = condition.op;
    double value = condition.value;
    switch (_operator)
    {
        case "==":
            query = query.Where(data => data.GetType().GetProperty(variable).GetValue(data, null).Equals(value));
            break;
        case "!=":
            query = query.Where(data => !data.GetType().GetProperty(variable).GetValue(data, null).Equals(value));
            break;
        case ">":
            query = query.Where(data => Convert.ToDouble(data.GetType().GetProperty(variable).GetValue(data, null)) > value);
            break;
        case "<":
            query = query.Where(data => Convert.ToDouble(data.GetType().GetProperty(variable).GetValue(data, null)) < value);
            break;
        // Handle other operators as needed
        default:
            // Handle unsupported operators or throw an exception
            return BadRequest("Unsupported operator");
    }
}
var filteredData = await query.Where(data => data.Data != null)
                  .Select(data => data.Id)
                  .ToListAsync();
filteredData basically returns the entire dataset because conditions is empty and thus no filtering based on the operator is happening.