【发布时间】:2021-09-01 06:18:57
【问题描述】:
嗨,我有下面的方法,我调用它并生成两个字符串值(分区键和行键)。而我的 json 没有这两个键,所以我想在我现有的 Json 中添加这两个值。
我需要帮助修改下面的代码以添加这两个键和值:
internal async Task<(string, string)> GenerateKeys( Dictionary<string, EntityProperty> arg )
{
var result = await GenerateValuesFromScript( arg, sbForKeyColumns );
return (result.First().ToString(), result.Last().ToString());
}
var content = JsonConvert.DeserializeObject<JObject>( lines );
await GenerateKeys( jsonDictionary );// above method is called and two values are returned
content.Add( new JProperty( "PartitionKey", "//this is where I have to pass the above 1st values" ) );
content.Add( new JProperty( "RowKey", "//this is where I have to pass the above 2nd values" ) );
【问题讨论】:
标签: c# json dictionary json.net jsonconvert