From 9b3920ae263e41371b4225a7fdd3fdc29644fe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 30 Mar 2023 16:37:40 +0300 Subject: [PATCH] Initial "Using Dapper with the ABP Framework" article. --- .../2023-03-20-Dapper/POST.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/en/Community-Articles/2023-03-20-Dapper/POST.md diff --git a/docs/en/Community-Articles/2023-03-20-Dapper/POST.md b/docs/en/Community-Articles/2023-03-20-Dapper/POST.md new file mode 100644 index 0000000000..0bea4b8ef9 --- /dev/null +++ b/docs/en/Community-Articles/2023-03-20-Dapper/POST.md @@ -0,0 +1,20 @@ +# Using Dapper with the ABP Framework + +[Dapper](https://github.com/DapperLib/Dapper) is a simple and lightweight object mapper for .NET. A key feature of Dapper is its [high performance](https://github.com/DapperLib/Dapper#performance) compared to other ORMs. In this article, I will show how to use it in your ABP projects. + +## When to use Dapper? + +In ABP Framework, we suggest to use Dapper in a combination with Entity Framework Core (EF Core) for the following reasons: + +* EF Core is much easier to use (you don't need to manually write SQL queries for example) +* EF Core abstracts different DBMS dialects, so it will be easier to change your DBMS later. +* EF Core is better compatible with Object Oriented Programming (OOP) practices and is more type safe to work with. So, EF Core code is more understandable and maintainable. + +In most of your use cases, you typically work with one or a few entities where the performance doesn't make much difference. However, there may be certain places in your application where it matters: + +* You may work with a lot of entities, so want to query faster. +* You may be performing too many database operations in a single request. +* EF Core may not create an optimized SQL query and you may want to manually write it for a better performance. + +In such cases, performance can be critical. Dapper can be a good choice if you want to easily write SQL queries and bind the result to your objects. +