List<userdetails> details = new List<userdetails>(); userdetails user = new userdetails(); details.Add(new userdetails { userid = 1, username = "suresh", location = "chennai" }); string strserialize = JsonConvert.SerializeObject(details);