1
I need to record the contents of an array that returned from a Json deserilization (return of a Json with more than one level), follow the line with the method that extracts the array:
Departmants dept = new Departmants();
dept.Property1 = JsonConvert.DeserializeObject<Department[]>(json);
Class with array structure:
public class Departmants
{
public Department[] Property1 { get; set; }
}
public class Department
{
public int id { get; set; }
public string name { get; set; }
public bool temSub{ get; set; }
public Sub[] subitem{ get; set; }
}
public class Sub
{
public int id { get; set; }
public string name { get; set; }
public bool temSub{ get; set; }
public object[] subitem{ get; set; }
}
I thank from the outset those who can help.
What approach are you using? Entityframework?
– Rodrigo Speller
Rodrigo, I’m using Framework 4.5.2.
– Cleber Pessoal
Rodrigo’s question is if you are using any ORM, like Entityframework, Dapper or if you are using ADO.NET in your project.
– Thiago Loureiro
only one detail, Departments and Departmants ;)
– Thiago Loureiro