我使用Rest Sharp反序列化但我不知道如何构建正确的类
JSON:
{ "LIST_ID":34468, "CREATED_PERSONAL_FIELDS":[], "EXISTING_PERSONAL_FIELD_NAMES":[ ["41028","Test1"] , ["41029","Test2"] ] }
我试过这堂课:
public class PersonalFieldsAddResponse
{
public string LIST_ID { get; set; }
public List<List<string>> SUBSCRIBERS_CREATED { get; set; }
public List<List<string>> BAD_PERSONAL_FIELDS { get; set; }
}
这一个:
public class PersonalFieldsAddResponse
{
public string LIST_ID { get; set; }
public List<string> SUBSCRIBERS_CREATED { get; set; }
public List<string> BAD_PERSONAL_FIELDS { get; set; }
}
反序列化确实为我提供了LIST_ID,但我总是在SUBSCRIBERS_CREATED和BAD_PERSONAL_FIELDS处获得NULL。
任何帮助将不胜感激。
答案 0 :(得分:0)
LOL, 它需要是:
public class PersonalFieldsAddResponse
{
public string LIST_ID { get; set; }
public List<List<string>> CREATED_PERSONAL_FIELDS { get; set; }
public List<List<string>> EXISTING_PERSONAL_FIELD_NAMES { get; set; }
}