I'm trying to convert JSON data into a model by serializing it with a class. However, I encounter an error when attempting to deserialize the data.
Here is my JSON data:
[{"Name":"Group1","Fields":[{"Field":"EmployeeSCP.Salary","Operator":"lt","Value":"50000","$$hashKey":"object:485"}],"Condition":"0"},
{"Name":"Group2","Fields":[{"Field":"EmployeeSCP.Salary","Operator":"gt","Value":"20000","$$hashKey":"object:495"}],"Condition":"0"},
{"groupCondition":"0"}]
Model:
public class ValidationModelData
{
public string Name { get; set; }
public List<FieldsData> Fields { get; set; }
public string Condition { 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; }
}
However, I am encountering an error during deserialization:
ValidationModelData validations = JsonConvert.DeserializeObject<ValidationModelData>(validation.JsonMetaData);