I have a very undesirable situation which requires me to deserialize the JSON where the values are field names with JSON.NET. Assuming that I have the following JSON which i
Hm you can try:
dynamic jObject = JObject.Parse(text);
List users = new List();
foreach(dynamic dUser in jObject)
{
List roles = new List();
User user = new User();
user.Name = dUser.name;
foreach(PropertyInfo info in dUser.GetType().GetProperties())
{
Role role = new Role();
role.Id = info.Name;
role.Name = dUser[info.Name].name;
roles.Ad(role);
}
user.Roles = roles.ToArray();
}