Here is the C# representation of your Json payload that can be used to de-serialize automatically with Newtonsoft Json or any other library.
I think you should keep your other logic separate from de-serialization
public class Order
{
public bool ascending { get; set; }
public string field { get; set; }
}
public class Group
{
public bool ascending { get; set; }
public string field { get; set; }
}
public class DiscoveryModel
{
public List<Order> order { get; set; }
public List<Group> groups { get; set; }
public int start { get; set; }
public int limit { get; set; }
}
You can create a function to get new model initialized like this
public DiscoveryModel GetModelForUpdate()
{
return new DiscoveryModel()
{
order = new List<Order>() { new Order() { ascending = true, field = "string" } },
groups = new List<Group>() { new Group() { ascending = true, field = "string" } },
start = 1,
limit = 10,
};
}