asp.net mvc - How to ues JsonConvert.DeserializeObject to convert array to Model in C# -


there data.

how convert model?

{"test": ["123","456"]} 

if have json string , want map c# class construct can use intigrated visual studio function paste json classes.

  1. copy json
  2. select edit –> paste special –> paste json classes

if visual studio make class:

public class rootobject {    public string[] test { get; set; } } 

to deserialize call:

var json = "{\"test\": [\"123\",\"456\"]}"; var myobject = jsonconvert.deserializeobject<rootobject>(json);  

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -