This article explains how to perform a very simple and lightweight database connection test for an existing database context. A while ago, I needed to develop a simple API that I can poll from a load balancer to see whether: This simple API would be used for monitoring purposes –…Continue reading How to verify connection to the database in Entity Framework Core?
Recently, while building an app service to host a .NET Core API, I had to implement the logic for using both Read-Only and Read-Write Database Contexts for Entity Framework Core. In this particular case, it was the same database – just different contexts, because depending on the location of the…Continue reading How to implement multiple Connection Strings for one DbContext in EF Core?
This article describes how to access and extract the connection strings from your Entity Framework (Core) database context objects. This is quite convenient if you need to display or log the connection string used for your current DbContext for some reason – or if you somehow form your DbContext objects…Continue reading How to get the EF Core Connection String?
This post describes how you can access your Entity Framework Core model classes and the database context in your Azure Functions. In my example I’m using EF Core 2.1, but the main principle should be the same for later versions as well. Please note, that I use Azure functions runtime…Continue reading How to access Entity Framework Core’s DbContext in an Azure Function?