Chamkey
Chamkey

Reputation: 105

C# .NET MVC List inside array

I have the following snippet of code. This is for an assignment and I'm not understanding what it is that is happening here. I'm supposed to create a styled list using the following:

{
  "students": [{
    "Name" : "Robert Mcguffin",
    "Registered" : "2014-07-20 05:34:16",
    "Student No:" : 1
} , {
    "Name" : "Agathe Dubois",
    "Registered" : "2014-05-30 09:46:26",
    "Student No:" : 2
} , {
    "Name" : "Steven Corral",
    "Registered" : "2015-02-11 09:58:16",
    "Student No:" : 3
}]}

I'm not sure what's going on here but I'm assuming it's a list inside an array. I'm not even sure that's possible. How would I declare this in MVC? If it's not a list inside an array then what is going on here?

Please help and thank you in advance.

Upvotes: 1

Views: 424

Answers (1)

Bee
Bee

Reputation: 26

What you see there is a JSON string with a List of Student Objects. Those Student objects have the properties Name, Registered and StudentNo.

Use this, so you can start making some parallelism between a JSON string and C# classes. Change the string and play a bit with it :)

http://json2csharp.com/

Upvotes: 1

Related Questions