I have this user class
public class User
{
public string name { get; set; }
public string phone { get; set; }
public string address { get; set; }
}
var users = new List<User>(){
new User(){
name = "Chriss",
phone = "45096820",
address = "xxx, street."
},
...
};
How do i return using ASP MVC Json method
return Json(users, JsonRequestBehavior.AllowGet);
that the return json format looks like the below
"Users" :
{
"Chris" :
{
"phone" : "45096820",
"address" : "xxx, street."
},
"Jason" :
{
"phone" : "406980968",
"address" : "xxx, street"
}
}