Looking to create a select query using JSON data
JSON data
{
"Data": [
{
"Name": "Group1",
"Fields": [
{
"Field": "EmployeeSCP.Salary",
"Operator": "lt",
"Value": "50000"
}
],
"Condition": "0"
},
{
"Name": "Group2",
"Fields": [
{
"Field": "EmployeeSCP.Salary",
"Operator": "gt",
"Value": "20000"
}
],
"Condition": "0"
},
],
"groupCondition": 0
}
My model
public class ValidationModelData
{
public List<Data> Data { get;set; }
public string groupCondition { get; set; }
}
public class FieldsData
{
public string Field { get; set; }
public string Operator { get; set; }
public string Value { get; set; }
}
public class Data
{
public string Name { get; set; }
public List<FieldsData> Fields { get; set; }
public string Condition { get; set; }
}
Using this information, I aim to construct a select query like this
select * from EmployeeSCP where salary < 50000 AND salary > 20000
If anyone can provide guidance, it would be greatly appreciated.