riskal
✅ Work Items List deserialization returns null in Title and Description
Class:
Deserialization:
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; }
}
}
lRootWorkItems = JsonConvert.DeserializeObject<RootWorkItems>(lResponseBody);
lRootWorkItems = JsonConvert.DeserializeObject<RootWorkItems>(lResponseBody);
9 replies