Mapping ASP.NET Core minimal API endpoints with C# source generators

I鈥檓 pretty late to the C# source generator party, but hey, better late than never 馃槄. In this post, let鈥檚 take a look at how we can automagically map minimal API endpoints using C# source generators

January 31, 2023 路 8 min 路 1624 words 路 Jo茫o Antunes

Beware of records, with expressions and calculated properties

I鈥檝e been using C# records a lot since the feature was introduced. However, when using them, we really need to understand how they work, otherwise we might face unexpected surprises.

September 1, 2022 路 6 min 路 1226 words 路 Jo茫o Antunes

[Video] Outbox meets change data capture - hooking into the Write-Ahead Log (feat. .NET, PostgreSQL & Kafka)

Another video on using change data capture (often referred to as CDC), to hook up into the database transaction log, forwarding incoming entries to the outbox table.

July 27, 2022 路 1 min 路 136 words 路 Jo茫o Antunes

[Video] What's the point of async/await in an ASP.NET Core application?

I鈥檝e been noticing in recent chats that folks have difficulty explaining why do we use async/await, tasks and related, when building ASP.NET Core applications.

May 30, 2022 路 1 min 路 93 words 路 Jo茫o Antunes

[Video] Polymorphic JSON Serialization (feat. .NET & System.Text.Json)

Time for one more video on messing with System.Text.Json, this time to get polymorphic (de)serialization going.

April 13, 2022 路 1 min 路 68 words 路 Jo茫o Antunes

OpenAPI extensions and Swashbuckle

Let鈥檚 take a quick look at OpenAPI extensions (which I discovered were a thing last week 馃槢) and how to add them to our API description using ASP.NET Core and Swashbuckle.

February 21, 2022 路 5 min 路 861 words 路 Jo茫o Antunes

Array or object JSON deserialization (feat. .NET & System.Text.Json)

Ah, the joys of integrating with third-party APIs鈥 We always end up having to hammer something to get things working 馃ぃ. This is a post about one of such situations, resorting to some JSON deserialization trickery (via JsonConverter) to be able to get things working.

January 31, 2022 路 4 min 路 689 words 路 Jo茫o Antunes

[Video] Outbox meets change data capture (feat. .NET, PostgreSQL, Kafka and Debezium)

Quick video with an interesting approach to implement the publisher part of the outbox pattern. Using change data capture (often referred to as CDC), we hook up something to the database transaction log, forwarding incoming entries to the outbox table. In this example, we鈥檒l make use of Debezium, hooked up into a PostgreSQL database, forwarding messages to Kafka.

January 17, 2022 路 1 min 路 89 words 路 Jo茫o Antunes

Getting a complex type as a simple type from the query string in a ASP.NET Core API controller

This is a tale of a good amount of hours of wasted time, so I鈥檓 going to document it so I remember it in the future. The idea is simple: when building an API, how can we treat a complex type as a simple type, to avoid things like primitive obsession, implement strongly typed ids and other related patterns? Let鈥檚 find out! 馃檪

January 3, 2022 路 8 min 路 1589 words 路 Jo茫o Antunes

[Video] Checking out NDepend

Let鈥檚 take a look at something that鈥檚 been around for years, but maybe flew under the radar: NDepend, a static code analysis tool tailored for .NET.

December 6, 2021 路 1 min 路 80 words 路 Jo茫o Antunes