---
title: "How to get the values from list of objects in c#"  
description: "How to get the values from list of objects in c#"  
author: "Manoj Bhatt"  
published: 2014-03-26  
updated: 2014-03-26  
canonical: https://www.mindstick.com/forum/1992/how-to-get-the-values-from-list-of-objects-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# How to get the values from list of objects in c#

I have Called a Json [Web Service](https://www.mindstick.com/articles/895/web-service-introduction) and got the [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) in c#.The [Json Web](https://www.mindstick.com/forum/159294/create-an-express-js-server-route-to-handle-user-login-authentication-using-jwt-json-web-tokens) service data is available in [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format):

```
 {  "Count": 9862,  "Items": [    {      "Admin": {        "S": "false"      },      "UserId": {        "S": "e9633477-978e-4956-ab34-cc4b8bbe4adf"      },      "Age": {        "N": "76.24807963806055"      },      "Promoted": {        "S": "true"      },      "UserName": {        "S": "e9633477"      },      "Registered": {        "S": "true"      }    },    {      "Admin": {        "S": "false"      },      "UserId": {        "S": "acf3eff7-36d6-4c3f-81dd-76f3a8071bcf"      },      "Age": {        "N": "64.79224276370684"      },      "Promoted": {        "S": "true"      },      "UserName": {        "S": "acf3eff7"      },      "Registered": {        "S": "true"      }    },
```

I have got the [Response](https://www.mindstick.com/forum/12719/how-to-make-response-write-display-special-character-like-lt-gt) like this in c#:

```
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost:8000/userdetails");        try        {            WebResponse response = request.GetResponse();            using (Stream responseStream = response.GetResponseStream())            {                StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);                return reader.ReadToEnd();            }        }
```

after finally successfully get the response i have got all the Data in [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp). and then parse this string in list of [objects](https://www.mindstick.com/forum/145447/what-are-objects) .Now I have list of objects where it showing the count in debugging.Now I want to [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) the [values](https://www.mindstick.com/forum/327/sum-textbox-values) like UserId:acf3eff7-36d6-4c3f-81dd-76f3a8071bcf like properties.I dont know how to do it.

Please help me and any help will be appreciated.

## Replies

### Reply by Pravesh Singh

Hi Manoj,\

You can use the following code to get the values from json as:

```
  JObject obj =JObject.Parse(json); int count =(int)obj["Count"];var Items =obj["Items"]; foreach (var item in Items)    var admin = item["Admin"];
```


---

Original Source: https://www.mindstick.com/forum/1992/how-to-get-the-values-from-list-of-objects-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
