I have an object that contains a Func property:
public class Foo {
public Func<int> DoCalculation {get;init;}
public string Bar {get;init;}
}
How can I exclude all Func<...> properties in any JSON serialization without using [JsonIgnore] or any other attribute?
Context:
- System.Text.JSON
- .net core 6