Я преобразую некоторую логику из Newtonsoft и обнаружил одну из следующей реализации < /p> [code] 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; } } [/code] Любой преобразовал Defaultcontractresolver в system.text.json