From 84b7b34211193a056a7fd43eaa3f7a71d26a319f Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Mon, 28 Nov 2022 14:45:51 +0300 Subject: [PATCH] quick fix --- .../2022-11-28-ef-bulk-operations/POST.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/Community-Articles/2022-11-28-ef-bulk-operations/POST.md b/docs/en/Community-Articles/2022-11-28-ef-bulk-operations/POST.md index d439edd070..1aa356bf3e 100644 --- a/docs/en/Community-Articles/2022-11-28-ef-bulk-operations/POST.md +++ b/docs/en/Community-Articles/2022-11-28-ef-bulk-operations/POST.md @@ -1,22 +1,22 @@ # Entity Framework Core Bulk Operations -Entity Framework tracks all the entity changes and applies those changes to database one by one when `SaveChanges()` method called. There was no way to execute bulk operations in Entity Framework Core without a dependency. +Entity Framework tracks all the entity changes and applies those changes to the database one by one when the `SaveChanges()` method is called. There was no way to execute bulk operations in Entity Framework Core without a dependency. -As you know [Entity Framework Extensions](https://entityframework-extensions.net/bulk-savechanges) library were doing it but it was not free. +As you know the [Entity Framework Extensions](https://entityframework-extensions.net/bulk-savechanges) library was doing it but it was not free. There was no other solution until now. [Bulk Operations](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew#executeupdate-and-executedelete-bulk-updates) are now available in Entity Framework Core with .NET 7. -With .NET 7, there are two new methods such as `ExecuteUpdate` and `ExecuteDelete` available to execute bulk operations. It's a similar usage with Entity Framework Core Extensions library if you're familiar with it. +With .NET 7, there are two new methods such as `ExecuteUpdate` and `ExecuteDelete` available to execute bulk operations. It's a similar usage with the Entity Framework Core Extensions library if you're familiar with it. You can visit the microsoft example [here](https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew#executeupdate-and-executedelete-bulk-updates) about how to use it. ## Bulk Operations in ABP Framework -ABP Framework supports Entity Framework Core as its ORM. So, you can use these new methods in your repository classes in your ABP applications. But there is another feature that ABP Framework provides: `IEfCoreBulkOperationProvider`. You can visit the [documentation](https://docs.abp.io/en/abp/latest/Entity-Framework-Core#customize-bulk-operations) to learn more about it. You always have full control of execution of bulk operations in your ABP applications. When you call `InsertMany`, `DeleteMany` or `UpdateMany` methods of repository, that provider will be invoked and you can customize all the queries from one point. Mostly you don't need to implement & customize that interface, but it's good to know that you can do it if you need. +ABP Framework supports Entity Framework Core as its ORM. So, you can use these new methods in your repository classes in your ABP applications. But there is another feature that the ABP Framework provides: `IEfCoreBulkOperationProvider`. You can visit the [documentation](https://docs.abp.io/en/abp/latest/Entity-Framework-Core#customize-bulk-operations) to learn more about it. You always have full control of the execution of bulk operations in your ABP applications. When you call the `InsertMany`, `DeleteMany` or `UpdateMany` methods of the repository, that provider will be invoked and you can customize all the queries from one point. You don't mostly need to implement & customize that interface, but it's good to know that you can do it if you need. ## Usage in Repositories -Most of real world case scenarios, you need custom queries to execute bulk operations. You can't manage all the cases with overriding `IEfCoreBulkOperationProvider` even you can't identify entities in this provider because it's not aware of the properties of entities. Best way to use this new feature is inside the repositories. +In most of the real world case scenarios, you need custom queries to execute bulk operations. You can't manage all the cases by overriding `IEfCoreBulkOperationProvider` and you can't even identify the entities in this provider because it's not aware of the properties of the entities. The best way to use this new feature is inside the repositories. Let me show an example below: @@ -48,10 +48,10 @@ public class BookEntityFrameworkCoreRepository : EfCoreRepository There is no need to take an action for bulk inserting. You can use `InsertManyAsync` method of repository instead of creating a new method for it if you don't have a custom logic. It'll use new bulk inserting feature automatically since it's available in EF Core 7.0. \ No newline at end of file +> There is no need to take an action for bulk inserting. You can use the `InsertManyAsync` method of the repository instead of creating a new method for it if you don't have custom logic. It'll use a new bulk inserting feature automatically since it's available in EF Core 7.0.