using System.Collections.Generic;
using Newtonsoft.Json.Linq;
public static void Main()
var nameMappings = new Dictionary<string, string>
string json1 = RenameProperties(json, nameMappings);
Console.WriteLine(json1);
public static string RenameProperties(string json, Dictionary<string, string> nameMappings)
JContainer token = (JContainer)JToken.Parse(json);
foreach (JProperty prop in token.Descendants().OfType<JProperty>().Reverse().ToList())
if (nameMappings.TryGetValue(prop.Name, out string newName))
prop.Replace(new JProperty(newName, prop.Value));