public override object ReadJson(JsonReader reader, Type objectType, object?existingValue, JsonSerializer serializer) { var value = (string)reader.Value !; // ReSharper disable once HeapView.BoxingAllocation return(Base64Encoded.Decode(value)); }
public override object ConvertFrom(ITypeDescriptorContext?context, CultureInfo?culture, object value) { if (value is string s) { // ReSharper disable once HeapView.BoxingAllocation return(Base64Encoded.Decode(s)); } return(base.ConvertFrom(context, culture, value) !); }