Similar Posts
Add/Remove TypeInfoResolver to existing JsonSerializerOptions
Starting with .NET 8, the JsonSerializerOptions class features a new TypeInfoResolverChain property in addition to the existing TypeInfoResolver property. With this new property, you are no longer required to specify all the resolvers in the same place, instead, you can add them later as needed. Let’s look at an example: Besides adding new type resolvers…
How to install .NET Aspire
.NET Aspire is a comprehensive, cloud-oriented framework designed for creating scalable, observable, and production-grade distributed applications. In this article we’ll look at the prerequisites of getting started with .NET Aspire. If you want an overview of .NET Aspire and what it brings to the table, check out our What is .NET Aspire article. There are…
Deep cloning and deep equality of a JsonNode
Starting with .NET 8, several new methods have been added to the JsonNode class to help with the deep cloning of nodes and checking whether they are equal or not. The DeepClone() method will create and return a deep clone of the current node and all of its descendants. On the other hand, DeepEquals() will…
C# ZIP files to Stream
.NET 8 include new CreateFromDirectory overloads which enable you to create a ZIP file without writing them to disk. This is particularly useful in situations where you don’t want to store the zipped resources, you use the Zip content only for transfer. For example: if you were to provide an API allowing multi-file download. That…
JsonNode – .NET 8 API updates
Part of .NET 8, JsonNode and JsonArray get a few new additions to their API. We’ve already covered deep copy and deep equality in an earlier article, but there’s more. GetValueKind Returns the JsonValueKind of the current instance. GetPropertyName Returns property name of the current node from the parent object. Throws an InvalidOperationException if the…
WPF – Individual dialog states using ClientGuid
A new ClientGuid property, introduced with .NET 8, allows you to uniquely identify dialogs such as the OpenFileDialog and the OpenFolderDialog, with the purpose of storing state – such as window size, position and last used folder – separately per dialog. To benefit from this behavior, configure the ClientGuid of your dialog to a known…