Base solution for your next web application
Open Closed

IRepository<T> BulkInsert extension method #6977


User avatar
0
mightyit created

I am working on a feature which deals with bulk dataprocessing and of which the performance and scalability aspects is critical.

During the execution of the operation I have to insert thousands of records to the database via EfCore. I am hoping to do this with a single trip to the database through a BulkInsert extension method on IRepository<T>.

I have read the following thread which creates the impression that this functionality has been incorporated into the Abp framework, but I am having trouble surfacing it https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3476

I have also noticed that there is a Nuget package Abp.EntityFrameworkCore.BulkExtensions, but this was last updated in 2017.

What is currently the recommended avenues to perform bulk database operations in AspNetZero / EfCore?


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Abp.EntityFrameworkCore.BulkExtensions is not an abp official package. You should use the Abp.EntityFrameworkCore.EFPlus mentioned in the issue.

    https://www.nuget.org/packages/Abp.EntityFrameworkCore.EFPlus

  • User Avatar
    0
    mightyit created

    As far as I can see the EFPlus library only offers extensions for bulk update and delete, not insert. Is this correct or am I mistaken?

  • User Avatar
    0
    maliming created
    Support Team

    Sorry, you are right, it has no Bulk insert. If you only use sql server as the database, you can try it with EFCore.BulkExtensions. Because EFCore.BulkExtensions only supports MsSQL (2008+)

    https://github.com/borisdj/EFCore.BulkExtensions