Posts

Showing posts from May, 2026

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...