System.Text.Json – Using anonymous types to customize serialization

It’s common to need to customize serialization. When you need to do this, you’d typically need to create a custom converter and pass it in during serialization. Depending on your scenario, an alternative approach is to use anonymous types, like this: Basically you select properties from another object and format them as desired, and then … Read more