[DataMember(EmitDefaultValue = false)]
[JsonProperty("extension_{0}_name")]
public string name {get; set;}
此数据正由对Azure域的查询检索,通过Postman,我可以看到在特定字段中填充的实际属性:
{
"extension_129af129412_name":"John",
...
}
哪里
129af129412
匹配
AzurePropertyExtensionId
属性,在my Web.Config中定义为:
<appSettings>
<add key="AzurePropertyExtensionId" value="129af129412" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
JsonConvert.DeserializeObject<>
未检索字段。我怀疑这是因为绑定是在一个字段上进行的
name_{0}_property
而不是
name_129af129412_property
.
xdt:Transform
Config的属性:编写它的人假设
JsonProperty
名称将被正确重写,但事实并非如此。一旦与序列化
JsonConvert
extension_{0}_name
. 这里出什么事了?
附带说明:在Azure中有一个有趣的行为,我们将用
{0}