JSON for List of int

前端 未结 2 1349
一个人的身影
一个人的身影 2020-12-13 23:59

I have a class

public class ItemList
{
    public long Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
             


        
2条回答
  •  爱一瞬间的悲伤
    2020-12-14 00:36

    JSON is perfectly capable of expressing lists of integers, and the JSON you have posted is valid. You can simply separate the integers by commas:

    {
        "Id": "610",
        "Name": "15",
        "Description": "1.99",
        "ItemModList": [42, 47, 139]
    }
    

提交回复
热议问题