所以我有这个课程:
public class Foo
{
public string EmailAddress { get; set; }
}
在我将其添加到请求正文中之前,我需要将它设为email_address
我试过了:
[SerializeAs(Name = "email_address")]
public string EmailAddress { get; set; }
但它不起作用。对此有何想法?
答案 0 :(得分:7)
修正了,我用了
[JsonProperty(PropertyName = "email_address")]
public string EmailAddress { get; set; }