How to handle parent-child relationships in .NET with Fluent Migrator’s fluent interface

Image for post
Image for post
A todo-list can have many to-do list items

In this article:

Introduction

Recap

In previous articles, we introduced NHibernate as the Object-Relational Mapper (ORM) to access data in a relational database. We then added transactions to keep data consistent. This will become more important in this article because we will expand our domain model with a one-to-many relationship.

Running Example

In this article, we’ll again be using as a running example a fictitious product named “Mahi”. …


Keeping your data consistent while avoiding code duplication

Image for post
Image for post
Boilerplate Code for Transactions

In this article:

Introduction

Recap

In the previous article we introduced NHibernate as the Object-Relational Mapper (ORM) to access data in a relational database. We managed to write and read objects, which was a good first step. In this article we’ll build on this and look at how we can keep data consistent.

Running Example

In this article we’ll again be using as a running example a fictitious product named “Mahi”. The word Mahi means “task” in Te Reo Māori, the language spoken by the native people of Aotearoa, the country also known as New Zealand. …


Storing and reading data in a relational database without writing SQL

Image for post
Image for post
Repository using NHibernate

In this article:

Introduction

Recap

In previous articles we looked at how to set up the development environment with Docker including a separate container for the relational database. We also looked at maintaining the database schema with Fluent Migrator and we updated the dev container to .NET 5.0. …


Changing the target framework and other dev environment improvements

Image for post
Image for post
Source: https://devblogs.microsoft.com/dotnet/introducing-net-5/

In this article:

Introduction

Previously, we looked at how to create a dev container for .NET Core 3.1. Since then .NET 5.0 has been released. Therefore, in this article we’ll look at how upgrade the dev container to reflect those changes.

Running Example

As always, we’ll again be using as a running example a fictitious product named “Mahi”. The word Mahi means “task” in Te Reo Māori, the language spoken by the native people of Aotearoa, the country also known as New Zealand. …


How to avoid issues caused by missing file change events when mounting Windows directories into a container

Image for post
Image for post

In this article:

Introduction

Originally, I though this article would be about object-relational mapping (ORM) on .NET Core. Then I ran into what I thought were issues with VS Code extensions when I ran up dev containers that made use of NTFS folders mounted into the dev container.

In the past my setup worked like a charm. However, recently I switched to WSL2 after I read several reports that in particular file operations were up to 2 to 4 times faster. …


Database Schema Maintenance with Fluent Migrator

Image for post
Image for post

In this article:

Introduction

Recap

In a previous article, we created a dev container (see article “Building a Dev Container for .NET Core”). Then we added a second container to run a database server we can use during development (see article “Dockerized SQL Server for Development”). This also served as an example how we can use pre-built container images to make our lives easier as developers.

At this point we have a working development environment but no code. In general, we can use this setup cross-platform, i.e. on Linux, Windows, MacOS, without any change required. …


How to quickly spin up and use a SQL Server instance cross-platform.

Image for post
Image for post
Compose file with database container

In this article:

Introduction

Recap

In my previous article I described how to create a full-time development container for .NET Core 3.1 with VS Code. The key point is that the development container (or short “dev container”) not only runs for specific tasks such like compiling, debugging, etc. The idea is to keep the dev container running all the time.

In that configuration VS Code’s frontend is running on the host while VS Code’s backend — VS Code Server — is magically installed and running in the dev container. The result is that as a developer we work seamlessly within the dev container. This includes VS Code extensions for which we can choose if we want them to be automatically installed in the dev container. …


How to create a full-time development container for .NET Core 3.1 with VS Code

Image for post
Image for post

In this article:

Important update as of 02 Dec 2020: If you are using Docker Desktop for Windows on WSL2, you may run into issues with VS Code extensions not working correctly. The article “Docker Desktop on WSL2: The Problem with Mixing File Systems” explains the reasons and how to avoid them.

Update 05 Jan 2021: If you are using .NET 5.0, then you might find the article “Upgrading a Dev Container to .NET 5.0” useful.

Introduction

Motivation

While some developers are highly productive using text editors such as VI, VIM, Notepad++, etc. that they combine with command line tools, others prefer integrated development environments (IDE). In this article we’ll be using Visual Studio Code. …

About

Manfred Lange

I’m a Principal Consultant at boutique firm HYPR Innovation in New Zealand. Currently, my main focus is helping clients to build scalable SaaS products.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store