skip to content
Relatively General .NET

Announcing C# 12

by Kathleen Dollard

posted on: November 14, 2023

Announcing the official release of C# 12, including collection expressions, primary constructors, and more!

Removing allocations by reducing closure scopes using local variables

by Gérald Barré

posted on: November 13, 2023

Lambdas can use variables from the enclosing methods (documentation), unless the lambda is static. When a variable is captured, the compiler generates code to create the bridge between the enclosing method and the lambda. Let's consider this simple example:C#copypublic void M() { var a = 0;

Automating Memory Profiling with the JetBrains dotMemory Profiler API

by Steve Gordon

posted on: November 10, 2023

Those who have read some of my previous performance-focused blog posts will know that I use the dotMemory product from JetBrains when working on code optimisations. In this post, I want to demonstrate a really handy, but somewhat underutilised feature, to automate the collection of snapshots in a repeatable way. I use these steps quite […]

Reading JSON and binary data from multipart/form-data sections in ASP.NET Core

by Andrew Lock

posted on: November 07, 2023

In this post I describe how to read both JSON and binary data from a multipart/form-data request using two approaches - MultipartReader and IFormFile…

Reading a stream of JsonDocuments separated by new lines (ndjson)

by Gérald Barré

posted on: November 06, 2023

There are formats where you need to read a stream of JsonDocuments separated by a character such as a new line. For instance, you can try to read data from a ndjson response. In this post, I'll show you how to read such a stream.A basic solution would be to split the stream by the separator and the

Avoiding flaky tests with TimeProvider and ITimer

by Andrew Lock

posted on: October 31, 2023

Exploring the .NET 8 preview - Part 12

File paths in a Roslyn analyzer or source generator

by Gérald Barré

posted on: October 30, 2023

In Roslyn, a SyntaxTree represents the content of a source file. If you need to know the source file that created this SyntaxTree, you can use the FilePath property. This property represents the file path on the disk. But, the file path on the disk may not be what you want.On CI, you should use rep

Understanding Migrations, Snapshots, and Synchronization in Entity Framework Core

by Ardalis

posted on: October 27, 2023

Entity Framework Core: Understanding Migrations, Snapshots, and Synchronization Entity Framework Core (EF Core) is a powerful tool for…Keep Reading →

Process Bloat: The Silent Killer of Developer Productivity

by Ardalis

posted on: October 24, 2023

Introduction In the exhilarating infancy stages of a software development project, teams are marked by agility, prompt decision-making, and…Keep Reading →

Short-circuit routing in .NET 8

by Andrew Lock

posted on: October 24, 2023

Exploring the .NET 8 preview - Part 11