0

I am trying to deserialize a JSON response. I have no familiarity with C#, so any help is appreciated. Here's the JSON.

{
    "Bookmark": ""
    "Items": [
        [
            {
                "Name": "Item",
                "Value": "A1233032"
            },
            ...
        ],
            {
                "Name": "Item",
                "Value": "B33032"
            },
            ...
        ],
        ...
    }
}

My C# code.

namespace Response
{
    using System;
    using System.Collections.Generic;
    using Terrasoft.Core.Entities;

    public class Item {
        public string Name;
        public string Value;
    }

    public class Items {
        public List<Item> ItemList = new List<Item>();
    }

    public class ItemResponse {
        public List<Items> Items = new List<Items>();
    }
}

Explanations that explains very basic concepts in C# would be appreciated. Thanks!

tytyf
  • 342
  • 1
  • 2
  • 11
  • 1
    You can check it out [here](https://stackoverflow.com/a/16857828/5533960) – Francisco Sevilla Jan 21 '20 at 18:57
  • Thanks will check it out! – tytyf Jan 21 '20 at 18:58
  • You need an explanation of what exactly ? If you are interested in understanding how serialization / deserialization work, I would suggest [reading the docs](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/serialization/) or this perhaps on [how to serialize and deserialize](https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to) – Jawad Jan 21 '20 at 19:35
  • Look for Newtonsoft Json. And learn how to use it... Very simple. – Jonathan Alfaro Jan 22 '20 at 01:37
  • Take a look at *[Convert JSON String To C# Object](https://stackoverflow.com/a/14904115/3744182)* and *[How to auto-generate a C# class file from a JSON object string](https://stackoverflow.com/q/21611674/3744182)*. – dbc Jan 22 '20 at 02:15

0 Answers0