Aspect-oriented programming with Metalama in .NET

#631 – October 25, 2026

repeated code for logging, validation, and timing spreads across .NET projects and becomes hard to maintain

Aspect-oriented programming with Metalama in .NET
12 minutes by Aram

Repeated code for logging, validation, and timing spreads across .NET projects and becomes hard to maintain. Metalama brings Aspect-Oriented programming to C# by generating that surrounding code at compile time, so each method stays focused on its actual purpose. You define a behavior once in an aspect, then apply it broadly using attributes or fabric queries. The result is less repeated code, consistent behavior, and easier-to-read business logic.

Agents write the code. You own what ships. Run and review them all in Rider with JetBrains Air.
sponsored by Jetbrains

More agent runs mean more code to check, spread across terminals and windows. JetBrains Air brings Claude Code, Codex, Junie, and others into Rider on accounts you already have. Agents can use Rider's IDE tools for context. You track every session, changed file, and commit in one place, and review diffs before anything ships. Install the Air plugin from the Marketplace in Rider 2026.2.

Adding properties with extension methods in C# 14
3 minutes by Steven Giesel

C# 14 extensions let you add properties to existing types in two creative ways. The first uses ConditionalWeakTable with StrongBox to attach data to objects without affecting garbage collection or losing null distinction. The second abuses Unsafe.As to treat objects as a mirrored subclass with extra fields, though this requires matching field layouts exactly. Both approaches are clever experiments, not production solutions.

A practical guide to API versioning in ASP.NET Core
11 minutes by Yogi Hosting

Yogi's guide explains how to implement API versioning in ASP.NET Core for Controllers and Minimal APIs. It covers generating version-specific OpenAPI documents, integrating Swagger UI and Scalar, and controlling which model properties appear in each version. Yogi also introduces automated API linting to detect breaking changes and maintain consistency, helping developers evolve their APIs safely and document them effectively.

Querying Roslyn syntax trees with XPath
28 minutes by Gérald Barré

MA0240 is a generic Roslyn analyzer rule that lets teams ban C# language constructs without writing custom analyzers. You add XPath queries to a BannedSyntaxes.txt file, and the rule reports violations using those patterns. The queries work against the syntax tree, semantic model, or compiler operation tree, so you can match things like implicit boxing or calls inside loops, not just code shapes. This turns what would normally be a new analyzer project into a single line in a text file.

An introduction to compact binary object representation in .NET
15 minutes by Andrew Lock

Compact binary object representation is a binary data format that works like JSON but produces smaller output, especially for numbers, booleans, and raw binary data. It is an official internet standard and supports streaming, unlike similar formats such as MessagePack. The .NET package System.Formats.Cbor provides low-level reading and writing tools, meaning you handle each field manually rather than converting whole objects automatically. It suits cases where payload size matters or binary data is common, though JSON remains the better default for most APIs.

And the most popular article from the last issue was:

newsletters