1

I managed to deserialize my Array in a list, but I can’t get the "instructions" array it returns me null, I don’t see or is my error, thanks for your help

[
    {
        "color": "#495145",
        "icon": "/var/spool/metrics.twds",
        "id": 1,
        "instructions": [
            {
                "content": "Architect Verbatim cum arum kumquat" 
                "id": 1,
                "resume": "microchip",
                "state": "GOOD"
            }
        ],
        "name": "Sante"
    },
    {
        "color": "#1b6940",
        "icon": "/sbin/protocol_baby_eyeballs.zip",
        "id": 2,
        "instructions": [
            {
                "content": "Architecto rerum sapiente asperiores omnis consequatur inventore aut sunt non. Rerum consequatur minus et sequi natus nam velit tenetur. Veritatis cum earum numquam aut. Maxime voluptatem illo voluptatem molestias.",
                "id": 1,
                "resume": "microchip",
                "state": "GOOD"
            }
        ],
        "name": "Intervention"
    }
]

we find the owners well and I put "instructions" in a list in another class but the problem still persists :

public class ReceiveMultipleData
    {

        public string color { get; set; }
        public string icon { get; set; }
        public string id { get; set; }
        public string name { get; set; }
        List<Instruction> instructions { get; set; }


    }

    public class Instruction
    {
        public string content { get; set; }
        public string id { get; set; }
        public string resume { get; set; }
        public string state { get; set; }

    }
dbc
  • 104,963
  • 20
  • 228
  • 340
lolinger
  • 11
  • 1
  • You can use https://json2csharp.com/ or https://app.quicktype.io/ to generate classes to parse json into. – Guru Stron Feb 01 '22 at 19:51
  • 1
    thanks for your help, I have understand where is my probleme thank you – lolinger Feb 01 '22 at 20:01
  • `instructions` needs to be **`public`**: **`public List instructions { get; set; }`** – dbc Feb 01 '22 at 21:03
  • Do you still need help with this, or can it be closed as "Not reproducible"? Or as a duplicate of [Why are some members missing when trying to print an object by serializing to JSON?](https://stackoverflow.com/a/48157367/3744182)? – dbc Feb 01 '22 at 21:13

0 Answers0