Posts

ASP.NET Core Pitfalls Index

These are the posts in the series: ASP.NET Core Pitfalls – Posting a String ASP.NET Core Pitfalls - Action Constraint Order ASP.NET Core Pitfalls - Content Type Mismatch

ASP.NET Core Extension Points Index

These are the posts in the series: ASP.NET Core Extension Points - Core ASP.NET Core Extension Points - MVC ASP.NET Core Extension Points - Minimal API (TBD) ASP.NET Core Extension Points - Razor Pages (TBD)

.NET Synchronisation APIs Index

These are the posts in the series: .NET Synchronisation APIs - Part 1 - In-Process Synchronisation .NET Synchronisation APIs - Part 2 - Out-of-Process Synchronisation .NET Synchronisation APIs - Part 3 - Distributed Synchronisation (TBD)

AI and LLMs in .NET Index

These are the posts in the series: Generating Structured Code Using Azure, OpenAI and .NET Using LLMs and MCP in .NET An Orchestration Framework for .NET Agents (TBD)

Series of Posts

This is a permanent post for listing the series of posts that are still ongoing, in no particular order: Topic Status .NET AI & LLMs Work in progress .NET Synchronisation APIs Work in progress (2 missing) ASP.NET Core Work in progress ASP.NET Core Extension Points Work in progress ASP.NET Core Multitenancy Work in progress (1 missing) ASP.NET Core Pitfalls Work in progress C#/ .NET Work in progress EF Core Work in progress EF Core Pitfalls Work in progress GitHub Work in progress Java ...

Less Known LINQ Methods

Introduction LINQ extension methods are pretty cool and they make our lives much easier. They are implemented as .NET extension methods over the Enumerable class in the System.Linq namespace and as usual they all apply to IEnumerable<T> sequences. This time I'll be talking about some LINQ methods that are not so commonly used (as per my understanding). Not sure about you guys, but sometimes I don't even remember that some of these exist. Aggregate/AggregateBy Aggregate applies an accumulator function over a sequence, reducing it to a single value. AggregateBy (.NET 9+) does the same but groups by a key first, producing one accumulated result per key. // Aggregate var product = new[] { 1, 2, 3, 4 }.Aggregate((acc, x) => acc * x); // 24 // AggregateBy var words = new[] { "apple", "ant", "bear", "bee" }; var lengthSums = words.AggregateBy( keySelector: w => w[0], seed: 0, func: (acc, w) => acc + w.Length...

MVP Renewed

Image
It was with great honour and sense of privilege that I received that email this Wednesday: I had been renewed as Microsoft Most Valuable Professional (MVP) again, for the period 2026-27! It is the third time in a row, and the 8th (I had previously been awarded from 2014-15 and until 2019. It is really a great privilege to be part of such a fantastic family, and I guess it's a recognition for something I did well - at least, so I hope! During the years I met many fellow MVPs, some of which became my friends, and I had a great time in Redmond, Bellevue, Seattle, Madrid, Rome, and Lisbon. It is a pity to see many of them gone from the programme, but there are new people, which is absolutely normal. I was actually away too for some years, until I was recommended by  Erik Ejlskov Jensen a couple years ago. I met lots of people from Microsoft, took part in 3 MVP Summits , attended many technical sessions,  and numerous Program Group Interactions and mailing list discussions. What I...

Using AWS Locally with MiniStack and .NET

Introduction When using AWS  for development, sometimes it is useful to have some sort of emulator, so that we don't incur in costs while doing development and debugging. For that, we have local cloud emulators, and LocalStack used to be the standard one not too long ago; the problem is, its licence changed and it is now generally not free. The good news is that there are alternatives that are free, such as MiniStack (GitHub:  MiniStack ), a free and open-source AWS cloud emulator that can emulate more than 55 AWS services and that is very similar to LocalStack. On this post I'll be talking about how to set it up so that we can point to it and use it as if it were the real thing with .NET. We will be using Docker Compose to spin up the local environment. Docker Compose We want to use the latest MiniStack image, which is made available from https://hub.docker.com/r/ministackorg/ministack . Our docker-compose.yml file will look like this: services: ministack: image: m...

C# Records

Introduction C# records and record structs  are relatively new. Records offer some advantages over regular classes and structs, which I will cover here, but they are essentially another way to declare them. This is another back to basics article. We essentially use records for: Entities, such as the ones we would store in a database Value objects/ Data Transfer Objects Immutable classes Let's now see how to work with them. Syntax Records are declared like this: public record Point(int X, int Y); Or like this, with the exact same meaning: public record Point { public int X { get; init; } public int Y { get; init; } } And we instantiate a record just like any other class or struct: Point p1 = new(1, 2); //or var p1 = new Point(1, 2); We can, of course, use  positional or named arguments : var p1 = new Point(Y: 2, X: 1); It is possible to add new properties (or methods) besides the ones declared on the primary constructor , we don't need to live with just those pro...

Docker Support for Isolator

Introduction Some of you may remember - and hopefully have even tried! - my Isolator project . Isolator is a framework for running isolated code for .NET. What this means is that possibly unsafe code can be run in a secure, isolated, way. It offers some quite different isolation strategies: Process isolation : the code to execute runs in another process, possibly under a different identity (on Windows only) Assembly isolation : uses an assembly load context to isolate the code execution, which is then unloaded Distributed isolation : the code to execute is sent to possibly another server for execution Scanned : the code to execute is first checked for problematic code using my ReferencesScanner project Now, I added support for Docker isolation! What this means is, if you have Docker running on your machine, you can spawn an image that will just be used for running your code, and after that will be gone. This provides another very restricted level of isolation. For Docker A...