string emp = responseongtask.Content.ReadAsStringAsync().Result;
(emp) Returned will be a json object you need to Deserialize it to mode.
using Newtonsoft.Json;
var data= JsonConvert.DeserializeObject<List<T>>(emp);
/// T here id you class/model(GetTaskID)
you can now do this
foreach(var d in data)
{
GetTaskID getTaskID = new GetTaskID
{
Task = d.Task,
Id = d.Id,
Enabled = false
};
checkedListBoxongoing.Items.Add(getTaskID, getTaskID.Enabled);
}
// To Deserialize below might be required in your model
[JsonProperty("Id")]
public int Id { get; set; }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…