Blog
Page 10 of 21
2023-10-26 csharpdotnetdotnet-8
C# – How to shuffle an array?
The easiest way to shuffle an array in C# is using Random.Shuffle, introduced in .NET 8. It works in-place on both arrays and spans.
2023-10-25 dotnetdotnet-8
System.Text.Json – How to modify existing type info resolver
Use the new WithAddedModifier extension method in .NET 8 to easily modify any IJsonTypeInfoResolver serialization contract without creating a new resolver from scratch.
2023-10-24 dotnetdotnet-8
HttpClient get JSON as AsyncEnumerable
The new GetFromJsonAsAsyncEnumerable extension method in .NET 8 deserializes HTTP response JSON into an IAsyncEnumerable. Learn how to use it with await foreach.
2023-10-23 dotnetdotnet-8
JsonNode – .NET 8 API updates
Explore the new .NET 8 API additions to JsonNode and JsonArray, including GetValueKind, GetPropertyName, GetElementIndex, ReplaceWith, and ParseAsync.
2023-10-22 dotnetdotnet-8
Deep cloning and deep equality of a JsonNode
Learn how to use the new DeepClone() and DeepEquals() methods on JsonNode in .NET 8 for deep cloning and comparing JSON nodes.
2023-10-21 dotnetdotnet-8
System.Text.Json – Disable reflection-based serialization
Learn how to disable reflection-based serialization in System.Text.Json starting with .NET 8 for trimmed and native AOT applications using the JsonSerializerIsReflectionEnabledByDefault property.
2023-10-20 csharp
C# – What is a NullReferenceException, and how to fix it?
Learn what causes a NullReferenceException in C#, how to debug it, and how to prevent it using null checks, the null-conditional operator, and nullable reference types.
2023-10-20 technology
YouTube: Missing option to delete channel
Missing the Remove YouTube Content option? Use YouTube Studio as a workaround to delete your channel when the standard option is unavailable.
2023-10-19 csharpdotnetdotnet-8
Add/Remove TypeInfoResolver to existing JsonSerializerOptions
Learn how to add or remove TypeInfoResolver instances on existing JsonSerializerOptions using the new TypeInfoResolverChain property in .NET 8.
2023-10-18 dotnetdotnet-8wpf
WPF – Prevent file dialog selection from being added to recents
Prevent WPF file dialog selections from appearing in Windows Explorer recents and the Start Menu by setting AddToRecent to false in .NET 8.