JSON for List of int

前端 未结 2 1345
一个人的身影
一个人的身影 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:32

    Assuming your ints are 0, 375, 668,5 and 6:

    {
        "Id": "610",
        "Name": "15",
        "Description": "1.99",
        "ItemModList": [
                           0,
                           375,
                           668,
                           5,
                           6
                       ]
    }
    

    I suggest that you change "Id": "610" to "Id": 610 since it is a integer/long and not a string. You can read more about the JSON format and examples here http://json.org/

提交回复
热议问题