我有这堂课:
public class TAccount
{
public Account account { set; get; }
public double transactionAmount { set; get; }
}
这节课:
public class Account
{
public int Id { set; get; }
public string AccountName { set; get; }
public double Balance { set; get; }
public string LastOperation { set; get; }
}
我想发布以下json字符串,但是我无法看到我正在尝试将值添加到TAccount
类
json字符串:
{ "TransactionAmount": 98, "Account":[{"Id" : 4 , "LastOperation" : "credit"}]}
感谢任何帮助。
答案 0 :(得分:0)
C#Classes:
public class TAccount
{
public Account account { get; set; }
public double transactionAmount { get; set; }
}
public class Account
{
public int Id { get; set; }
public string AccountName { get; set; }
public double Balance { get; set; }
public string LastOperation { get; set; }
}
尝试使用此结构发送:
{
"transactionAmount": 98,
"account": {
"Id": 4,
"LastOperation": "credit"
}
}