【发布时间】:2015-08-08 11:50:13
【问题描述】:
我希望你能再次帮助我,我有一个包含对象容器的 c# 类,我需要从 json 对象填充这个类对象。
public class user { public string name {get;set;} public userAttributes {get;set;}}
public class userAttributes { int id {get; set;} string value {get;set;}}
我正在使用 google postman 使用 url 编码选项来传递参数,但我不知道能够获取此参数的确切 json 格式是什么。我正在像这样传递 userAttribute:
"userAttributes": [
{
"Values": [
{
"id": 1,
"Value": "sample string 2"
},
{
"id": 1,
"Value": "sample string 2"
}
]
【问题讨论】:
-
SerializeuserAttributes类型的对象,你有它。
标签: c# .net json asp.net-web-api