-1

I want to retrieve the values from a Json array in my c# controller. Here's my json array :

 {
    name : "Name 1", 
    description : "Description 1",
     count : 6
    }

How i can retrieve each attribute in my c# controller ? i know how to do it if i deal with Objects but this json is not from a Object.

 public IList[] getList(IList[] myList)
        {
  // How to get the value of the name and the description here ?

}
1
  • To much code to do a simple task ! I will finally create a class with all the attribute i will need and then retrieve them this way : myList.name, myList.description, etc. Commented Feb 9, 2016 at 15:04

1 Answer 1

1

I will finally create a class with all the attributes i will need and then retrieve them the same way i do with an Object :

 CustomClass myClass ;

 string name = myClass.name
 string description = myClass.description;
 int count= myClass.count
 ...
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.