I've starting using record types to avoid all the boiler plate code that comes along with regular classes.
This generally works fine as I can use JsonPropertyAttribute with record type parameters like this
public record MyObject([JsonProperty("customName")] string SomeProperty);
however JsonIgnoreAttribute does not support properties so I can't do
public record MyObject(
[JsonProperty("customName")] string SomeProperty,
[JsonIgnore] string?OtherThing);
and need to fallback to using classes in those cases.
It would be great if JsonIgnoreAttribute could also support parameters like JsonPropertyAttribute does.
I've starting using record types to avoid all the boiler plate code that comes along with regular classes. This generally works fine as I can use
JsonPropertyAttribute
with record type parameters like thishowever
JsonIgnoreAttribute
does not support properties so I can't doand need to fallback to using classes in those cases.
It would be great if
JsonIgnoreAttribute
could also support parameters likeJsonPropertyAttribute
does.