If you already have a json string and want it to map it to a C# class construct you can use the intigrated Visual Studio function Paste Json as Classes.
- Copy some JSON
- Select Edit –> Paste Special –> Paste JSON As Classes
If you do so Visual Studio will make for you this class:
public class Rootobject
{
public string[] test { get; set; }
}
Side note:
If you are not using Visual Studio you can go visit this site. Which will provide you the same feature with a similar result.
To deserialize you simply call:
var json = "{\"test\": [\"123\",\"456\"]}";
var myObject = JsonConvert.DeserializeObject<Rootobject>(json);