I am using .net Maui MVVM source generators to create properties as observable properties. I am using System.Text.Json.Serialization to serialize the properties of a class to JSON. When I use [JsonIgnore] on some properties they still get serialized to JSON. Is there any other way of ignoring properties?
I assume that the problem is that I am putting the decorator on the private property declaration and not the public one as the public ones are created in dependencies -> analyzers -> CommunityToolkit.Mvvm.SourceGenerators.
[property: JsonIgnore]
. I don't know if that is in production build yet. – Due[JsonIgnore(Condition = JsonIgnoreCondition.Always)]
– Wellmeaning