Добавлено: 26 октября 2023 г.
How to implement CQRS in ASP.NET using MediatR. A guided example using CQRS with separate Read and Write models using Enity Framework Core for Commands and Dapper for Queries.
When people think about CQRS they often think about complex, event-driven, distributed architectures with separate Read and Write databases. Using different databases for Read and Write means we can use a Polyglot Architecture, where we pick a database that perfectly fits the...
далее...
Добавлено: 26 июля 2023 г.
Built with .NET 7.0, Dapper 2.0 and PostgreSQL
In this tutorial we'll show how to build a .NET 7.0 (ASP.NET Core) API with Dapper and PostgreSQL that supports CRUD operations.
Tutorial contents
Example API overview
Tools required to run the .NET 7.0 API
Run the CRUD example API locally
Test the API with Postman
Connect an Angular...
далее...
Добавлено: 8 мая 2023 г.
Dapper is a lightweight ORM (Object-Relational Mapping) framework for .NET Core and is commonly used to query databases in .NET Core applications. Here are some of the advanced features of Dapper in .NET Core:
Multi-Mapping: Dapper allows you to map multiple database tables to a single class. This is useful when you need to retrieve data from multiple tables and map them to a single object.
...
далее...
Добавлено: 10 марта 2023 г.
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...
далее...
Добавлено: 11 января 2023 г.
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...
далее...
Добавлено: 24 октября 2022 г.
Entity Framework Core is recommended and the most popular tool for interacting with relational databases on ASP NET Core. It is powerful enough to cover most possible scenarios, but like any other tool, it has its limitations. Long time people said (not without reason) that Entity Frmaework does not match high load systems and for these scenarios it is better to use Dapper. But time goes by and Entity Framework...
далее...
Добавлено: 15 июля 2019 г.
ORM: Object Relationship Mapper that maps your database directly with C# objects.
There are many ORM tools available. One of them is Dapper. Dapper is known as the king of ORM.
The following are the key features of Dapper:
Speed and fast in performance.
Fewer lines of code.
Object Mapper.
Static Object Binding.
Dynamic Object Binding.
...
далее...
Добавлено: 8 января 2019 г.
There's no doubt that Entity Framework with LINQ is great (I've certainly written enough articles about it). But Entity Framework comes at a cost. As Matthew Jones points out on his blog, using LINQ+Entity Framework adds time to each data retrieval compared to using ADO.NET's SqlDataAdapter. The cost is small (anywhere from a third of a millisecond to 100 milliseconds) but it's not zero, either.
If speed is important to...
далее...