我创建了以下模型
public class ListLavorationCodeClient
{
public string LavorationsCode { get; set; }
}
在我的代码中,我写道:
var listLavorationsCode = new ListLavorationCodeClient()
{
LavorationsCode = codiceLavorazioneXx
};
,结果如下:
{
"LavorationsCode": "30410040136042700157"
}
{
"LavorationsCode": "30440040136042700157"
}
相反,我想要一个这样的结果:
{
"LavorationCode": { "30410040136042700157", "30440040136042700157" }
}
我该如何解决?
答案 0 :(得分:0)
您需要更改变量本身:
public string[] LavorationsCode { get; set; }