Hi
Is there someone how knows/sees what I am doing wrong ...
I seem to be missing the point here:
I have a json string (got by webService):
- var mRestClient = new RestClient();
- mRestClient.AddDefaultHeader("Authorization", "Bearer " + );
- var getRequest = new RestRequest(Method.GET);
- System.Net.HttpStatusCode returnStatus = mRestClient.Get(getRequest).StatusCode;
- string json = mRestClient.Get(getRequest).Content;
then my string json contains:
- {
- "items" : [ {
- "id" : "459cb42f-2190-4cd3-a0c4-610130611316",
- "name" : "you name it ...",
- "externalId" : "c2002c7a-32bd-4d04-ba0c-c0633e4bc7a5",
- "start" : "2020-01-01",
- "finish" : "2020-06-01",
- "manager" : {
- "id" : "1cce4511-2c6a-4070-b1bc-7a863b4f34bb"
- }, {…}
- ]
- }
I just want to get id and name with this code:
and I have the declare ...
- public class TestProjectList
- {
- public TestProject[] TestProject { get; set; }
- }
- public class TestProject
- {
- public string _id { get; set; }
- public string _name { get; set; }
- }
After execute this line …
- TestProject testProjectList = JsonConvert.DeserializeObject(json);
testProjectList contains:
Thanks for every hint.