EFCore.BulkExtensions | Entity Framework EF Core efcore Bulk Batch Extensions | SQL Database library

 by   borisdj C# Version: 6.5.6 License: Non-SPDX

kandi X-RAY | EFCore.BulkExtensions Summary

kandi X-RAY | EFCore.BulkExtensions Summary

EFCore.BulkExtensions is a C# library typically used in Database, SQL Database applications. EFCore.BulkExtensions has no bugs, it has no vulnerabilities and it has medium support. However EFCore.BulkExtensions has a Non-SPDX License. You can download it from GitHub.

EntityFrameworkCore extensions: -Bulk operations (Insert, Update, Delete, Read, Upsert, Sync, Truncate) and -Batch ops (Delete, Update). Library is Lightweight and very Efficient, having all mostly used CRUD operation. Was selected in top 20 EF Core Extensions recommended by Microsoft. Current version is using EF Core 5 and is targeting NetStandard 2.1 so it can be used on project targeting Net 5. At the moment supports Microsoft SQL Server(2008+) and SQLite. Under the hood uses SqlBulkCopy for Insert, for Update/Delete combines BulkInsert with raw Sql MERGE. For SQLite there is no BulkCopy, instead library uses plain SQL combined with UPSERT. Bulk Tests can not have UseInMemoryDb because InMemoryProvider does not support Relational-specific methods. Available on Package manager console command for installation: Install-Package EFCore.BulkExtensions | Nuget | Target | Used EF v. | For projects targeting | | ----- | --------------- | ----------- | ------------------------------- | | 5.x | NetStandard 2.1 | EF Core 5.0 | Net 5+ | | 3.x | NetStandard 2.0 | EF Core 3.n | NetCore(3.0+) or NetFrm(4.6.1+) MoreInfo| | 2.x | NetStandard 2.0 | EF Core 2.n | NetCore(2.0+) or NetFrm(4.6.1+) | | 1.x | NetStandard 1.4 | EF Core 1.0 | NetCore(1.0+) |.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              EFCore.BulkExtensions has a medium active ecosystem.
              It has 3123 star(s) with 520 fork(s). There are 86 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 25 open issues and 820 have been closed. On average issues are closed in 241 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of EFCore.BulkExtensions is 6.5.6

            kandi-Quality Quality

              EFCore.BulkExtensions has 0 bugs and 0 code smells.

            kandi-Security Security

              EFCore.BulkExtensions has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              EFCore.BulkExtensions code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              EFCore.BulkExtensions has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              EFCore.BulkExtensions releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of EFCore.BulkExtensions
            Get all kandi verified functions for this library.

            EFCore.BulkExtensions Key Features

            No Key Features are available at this moment for EFCore.BulkExtensions.

            EFCore.BulkExtensions Examples and Code Snippets

            No Code Snippets are available at this moment for EFCore.BulkExtensions.

            Community Discussions

            QUESTION

            Navigation Property Not Saving with BulkInsert()
            Asked 2021-Jul-10 at 21:02

            Using EFCore 3.1 with the library EFCore.BulkExtensions 3.6.1 (latest version for EFCore 3.1).
            Database server is SQL Server 2019.

            Here is code to reproduce the error.
            A simple Customer class with a navigation property from another class:

            ...

            ANSWER

            Answered 2021-Jul-10 at 21:02

            As it stands right now, this is a bug in the EFCore.BulkExtensions library - versions 3.2.1 through 3.3.5 will handle it (mostly) correctly, versions 3.3.6 - 3.6.1 do not.

            Use version 3.3.5 for the most stable result, as of this writing.

            (No data on version 5.x for EFCore 5)

            Source https://stackoverflow.com/questions/68306638

            QUESTION

            BulkInsertAsync from EFCore.BulkExtensions doesn't seem to insert anything
            Asked 2021-Feb-03 at 15:59

            I'm using EFCore.BulkExtensions to insert batches of, at most, 100,000 records into a database.

            My issue is, for some reason, BulkInsertAsync does not insert any records to the DB. I understand it's an asynchronous call, but I've waited half an hour and no data was inserted. The regular, synchronous BulkInsert call works, but is extremely suboptimal since it hogs a ton of process time.

            Does anyone have any idea why BulkInsertAsync doesn't work in this context, but BulkInsert does?

            Here is the relevant code, which marshals binary data (transmitted from another machine) into a C struct, adds that C struct to a list, and then bulk-inserts the list into the database.

            ...

            ANSWER

            Answered 2021-Feb-03 at 15:59

            The method should do something - if you await it.

            So instead of: db.BulkInsertAsync(records); do: await db.BulkInsertAsync(records);

            Essentially, you told it to execute an async task, then you exited the method that created / owned the task by not calling await, causing the task to be abandoned. There's some subtle magic going on with the async tasks, LOL.

            Source https://stackoverflow.com/questions/66030123

            QUESTION

            BulkInsertOrUpdate with child entity use of efcore.bulkextensions
            Asked 2020-Nov-11 at 07:01

            I am using BulkInsertOrUpdateAsync method to upsert the 20000 records in net-core 3.0. There is no error at all when doing this. it is upserting all the record with parent and child entity into database.

            ...

            ANSWER

            Answered 2020-Nov-11 at 07:01

            Here is answer for this

            Source https://stackoverflow.com/questions/64041166

            QUESTION

            C# Entity Framework: Update Only First Batch Records and Stop
            Asked 2020-Aug-21 at 03:49

            Is there way with EF Core Bulk extensions to only update first few 10000 rows? write message, update next batch, write message in loop until complete?

            I know there is Batch Size, however if there is only 5 million to update, and I want only update a certain amount, write a message, in continual loop until complete, how can this be done?

            Should I use Top or Take?

            I want to write "Hello", every few batches.

            ...

            ANSWER

            Answered 2020-Aug-20 at 23:52

            It looks like BatchSize is only used for bulk insert. For update the expression is translated to a single SQL UPDATE statement, which doesn't operate by "batches".

            Source https://stackoverflow.com/questions/63514362

            QUESTION

            How do I use EFCore.BulkExtensions in ASP.NET Boilerplate
            Asked 2020-May-29 at 05:51

            I need to do bulk insert in ASP.NET Boilerplate and I tried to implement EFCore.BulkExtensions after reading https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4397 .

            I installed the latest EFCore.BulkExtensions from nuget into the project and I tried to use doContext as below so that I can use wherever required.

            ...

            ANSWER

            Answered 2020-May-29 at 05:51

            I need to download a lower version of EFCore.BulkExtensions (2.4.7) nuget as the latest version did not support EF 2.2.4

            Source https://stackoverflow.com/questions/61391215

            QUESTION

            EFCore BulkInsert with one to one relationship
            Asked 2020-Apr-24 at 11:35

            I'm trying to use bulkinsert from EFCore.BulkExtensions in .NET Core 2.1 with one to one relationships. I have 2 Database Entities

            ...

            ANSWER

            Answered 2020-Apr-23 at 23:13

            This is probably what you're looking for since you also want to insert child properties.

            context.BulkInsert(Entity1ItemsList, options => options.IncludeGraph = true);

            You can read further here:

            Source https://stackoverflow.com/questions/61398094

            QUESTION

            EFCore Bulk Insert & SQLite In Memory: no such table: INFORMATION_SCHEMA.COLUMNS"
            Asked 2020-Mar-17 at 08:13

            I'm using EFCore BulkExtensions 2.5.0 with Entity Framework Core 2.2.3 and EFCore.SQLite 2.2.6.

            I have code like this:

            ...

            ANSWER

            Answered 2020-Mar-17 at 08:13

            Looks like this is a bug in EFCore.BulkExtensions for 2.5.0 where it didn't have full SQLite support. It works with version 2.6.4: https://github.com/borisdj/EFCore.BulkExtensions/issues/308

            Source https://stackoverflow.com/questions/60690567

            QUESTION

            EF Core Bulk Extensions: Index was out of range on BulkInsert
            Asked 2020-Feb-07 at 07:57

            I am getting the following error while using bulk insert from EF core bulk extensions:

            Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') at System.Collections.Generic.List1.get_Item(Int32 index) at EFCore.BulkExtensions.TableInfo.UpdateEntitiesIdentity[T](IList1 entities, IList1 entitiesWithOutputIdentity) at EFCore.BulkExtensions.TableInfo.LoadOutputData[T](DbContext context, IList1 entities) at EFCore.BulkExtensions.SqlBulkOperation.Merge[T](DbContext context, IList1 entities, TableInfo tableInfo, OperationType operationType, Action1 progress) at EFCore.BulkExtensions.DbContextBulkExtensions.BulkInsert[T](DbContext context, IList1 entities, BulkConfig bulkConfig, Action1 progress)
            at MyProject.Data.Repository.Repository1.CreateRange(List1 entities)

            I have a parent entity and child entity. What I am trying to do is, first bulk insert parent and then assign Ids generated for parent to their children. Then bulk insert children.

            CreateRange method:

            ...

            ANSWER

            Answered 2020-Feb-07 at 07:57

            The exception occurs due to the Ids being assigned before the bulk insert operation is conflicting with the Ids already existing in the database. The solution is to use Ids that are not in the database. For example, negative numbers. This can still preserve the order of insertion since what matters is the relative order between entities within the list to be inserted.

            The modified code:

            Source https://stackoverflow.com/questions/60087448

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install EFCore.BulkExtensions

            You can download it from GitHub.

            Support

            If you find this project useful you can mark it by leaving a Github Star ⭐. If you would like to support the Project by making a Donation ($10) #BuyMeBeer, you are welcome to do so: or (0 fee) Please read CONTRIBUTING for details on code of conduct, and the process for submitting pull requests. Want to Contact us for Hire (Development & Consulting): www.codis.tech.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

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

          • CLI

            gh repo clone borisdj/EFCore.BulkExtensions

          • sshUrl

            git@github.com:borisdj/EFCore.BulkExtensions.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link