Код: Выделить всё
public class CustomDataContractResolver : DefaultContractResolver
{
public Dictionary FieldNameChanges { get; set; }
public List FieldValueReplica { get; set; }
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
{
var property = base.CreateProperty(member, memberSerialization);
if (property.DeclaringType != typeof(logEvent)) return property;
if (FieldNameChanges.Count > 0 && FieldNameChanges.TryGetValue(property.PropertyName, out var newValue))
property.PropertyName = newValue;
return property;
}
}
Подробнее здесь: https://stackoverflow.com/questions/647 ... -text-json