Writing unit test code when using the Dapper ORM tool for database operations with ASP.NET Core Web Application
How to write unit tests with Dapper
Writing unit tests when using the Dapper ORM tool for database operations in an ASP.NET Core Web Application can be complex. This is because Dapper uses static extension methods that are difficult to mock when testing services.
There is one approach to resolving this problem. We need to...
далее...
In this article, I’ll show you all the object mapping strategies of EF Core and especially the new one: TPC Inheritance Mapping. TPC mapping is the new feature introduced with Entity Framework Core 7. It’s called Table Per Concrete type inheritance mapping. I’ll explain the EF Core’s inheritance mapping strategies with how the inherited entity and the specific information are saved into a relational database. I’ll also explain which strategy...
далее...
Database Setup with DbUp + Postgresql + Dapper in ASP.Net Core
In this tutorial, we are going to explore how we can setup our database on startup when using Dapper for accessing database.
When using Dapper, one of the key learning I came to know is that we have to have database and tables already created in advance in order to read/write data.
So we have to write some kind of migration logic...
далее...
Here’s the simple step-by-step guide that will teach you how to build and code a generic repository.
There are oodles of design patterns.
Some of these design patterns are floating about on antique blogs full of mad logic. They’re ridiculous enough to make the entire modern cloud rub its belly in roars of laughter.
Other design patterns are worth their dough.
And one of these is the repository pattern.
Of all the design patterns that...
далее...
Keeping our SQL server in a healthy state is a matter of concern for sure. Here users can learn the top 11 SQL server maintenance plan best practices that experts, DBAs, architects, and developers follow. No doubt that users often face difficulties with their SQL server. However, with these practices to keep the database healthy, users can reduce the chances of SQL server errors by 90%. Let’s begin securing the...
далее...