0

I have the following class object structure:

public class StatusObj3
{
    public int status { get; set; }
    public DataObj3 data { get; set; }
}

public class DataObj3
{
    public string survey_id { get; set; }
    public string date_created { get; set; }
    public string date_modified { get; set; }
    public int custom_variable_count { get; set; }
    public List<Custom_VariablesObj> custom_variables { get; set; }
    public int language_id { get; set; }
    public int num_responses { get; set; }
    public int question_count { get; set; }
    public string nickname { get; set; }
    public TitleObj title { get; set; }
    public List<PagesObj> pages { get; set; }
}

public class Custom_VariablesObj
{
    public string variable_label { get; set; }
    public string question_id { get; set; }
}

public class TitleObj
{
    public bool enabled { get; set; }
    public string text { get; set; }
}

public class PagesObj
{
    string page_id { get; set; }
    string heading { get; set; }
    string sub_heading { get; set; }
    public List<QuestionObj> questions { get; set; }
}

public class QuestionObj
{
    public string question_id { get; set; }
    public string heading { get; set; }
    public string position { get; set; }
    public QuestionTypeObj type { get; set; }
    public List<AnswerObj> answers { get; set; }
}

public class QuestionTypeObj
{
    public string family { get; set; }
    public string subtype { get; set; }
}

public class AnswerObj
{
    public string answer_id { get; set; }
    public int position { get; set; }
    public string text { get; set; }
    public string type { get; set; }
    public bool visible { get; set; }
    public int weight { get; set; }
    public bool apply_all_rows { get; set; }
    public bool is_answer { get; set; }
    public List<ItemsObj> items { get; set; }
}

public class ItemsObj
{
    public string answer_id { get; set; }
    public int position { get; set; }
    public string type { get; set; }
    public string text { get; set; }
}

I 've deserialized json into this object via:

   var results_SurveyDetails = deserializer.Deserialize<StatusObj3>(json_returned);

I'm trying to loop thru the pages by:

    foreach (var page in results_SurveyDetails.data.pages)

However, not all members of page are available to use. Only the page.questions is there and not page_id, heading and subheading.

What am I doing wrong?

KeithL
  • 5,348
  • 3
  • 19
  • 25

1 Answers1

4

You are missing public on your other properties in class PagesObj.

Quality Catalyst
  • 6,531
  • 8
  • 38
  • 62
yume_chan
  • 858
  • 9
  • 22