Skip to content

Instantly share code, notes, and snippets.

@mgravell
Created September 20, 2022 06:36
Show Gist options
  • Save mgravell/19e705577a60d2d99ea8e05b6becd25e to your computer and use it in GitHub Desktop.
Save mgravell/19e705577a60d2d99ea8e05b6becd25e to your computer and use it in GitHub Desktop.
[ProtoContract]
class Foo
{
public JToken? Bar { get; set; }
[ProtoMember(1)]
[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Used for serialization")]
private string? BarSerialized
{
get => Bar?.ToString();
set => Bar = value is null ? null : JToken.Parse(value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment