riskal
riskal
CC#
Created by riskal on 12/6/2022 in #help
✅ Work Items List deserialization returns null in Title and Description
Class:
namespace Service.AzureDevops
{
public class Fields
{
[JsonPropertyName("System.Title")]
public string Title { get; set; }
[JsonPropertyName("System.Description")]
public string Description { get; set; }
}
public class Value
{
[JsonPropertyName("id")]
public int ID { get; set; }
[JsonPropertyName("fields")]
public Fields Fields { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; }
}
public class RootWorkItems
{
[JsonPropertyName("value")]
public List<Value> Value { get; set; }
}
}
namespace Service.AzureDevops
{
public class Fields
{
[JsonPropertyName("System.Title")]
public string Title { get; set; }
[JsonPropertyName("System.Description")]
public string Description { get; set; }
}
public class Value
{
[JsonPropertyName("id")]
public int ID { get; set; }
[JsonPropertyName("fields")]
public Fields Fields { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; }
}
public class RootWorkItems
{
[JsonPropertyName("value")]
public List<Value> Value { get; set; }
}
}
Deserialization:
lRootWorkItems = JsonConvert.DeserializeObject<RootWorkItems>(lResponseBody);
lRootWorkItems = JsonConvert.DeserializeObject<RootWorkItems>(lResponseBody);
9 replies