{"id":19740746,"url":"https://github.com/zzzprojects/entityframework-extensions","last_synced_at":"2025-05-16T04:03:36.748Z","repository":{"id":41420206,"uuid":"52172541","full_name":"zzzprojects/EntityFramework-Extensions","owner":"zzzprojects","description":"Entity Framework Bulk Operations | Improve Entity Framework performance with Bulk SaveChanges, Insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL and SQLite.","archived":false,"fork":false,"pushed_at":"2025-05-06T20:11:52.000Z","size":2973,"stargazers_count":354,"open_issues_count":83,"forks_count":55,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-13T21:23:06.505Z","etag":null,"topics":["batch","bulk-inserts","bulk-operation","bulk-savechanges","c-sharp","csharp","dotnet","dotnet-core","dotnet-standard","ef6","efcore","entity-framework","entity-framework-core","entityframework","sqlbulkcopy"],"latest_commit_sha":null,"homepage":"https://entityframework-extensions.net","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzzprojects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-20T19:56:40.000Z","updated_at":"2025-05-05T15:37:24.000Z","dependencies_parsed_at":"2023-01-30T02:15:50.107Z","dependency_job_id":"96da2e37-d80a-4716-9516-ac3eeb1743a4","html_url":"https://github.com/zzzprojects/EntityFramework-Extensions","commit_stats":null,"previous_names":[],"tags_count":607,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FEntityFramework-Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FEntityFramework-Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FEntityFramework-Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzzprojects%2FEntityFramework-Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzzprojects","download_url":"https://codeload.github.com/zzzprojects/EntityFramework-Extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464891,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch","bulk-inserts","bulk-operation","bulk-savechanges","c-sharp","csharp","dotnet","dotnet-core","dotnet-standard","ef6","efcore","entity-framework","entity-framework-core","entityframework","sqlbulkcopy"],"created_at":"2024-11-12T01:23:03.524Z","updated_at":"2025-05-16T04:03:36.720Z","avatar_url":"https://github.com/zzzprojects.png","language":"C#","readme":"# What's Entity Framework Extensions? \n\nEntity Framework Extensions is a library that dramatically improves EF performances by using bulk and batch operations.\n\nPeople using this library often report performance enhancement by 50x times and more!\n\n## Improve Entity Framework performance with Bulk SaveChanges and Bulk Operations\n\nSolve Entity Framework performance issue when saving with high performance bulk operations and hundreds of flexibles feature.\n - BulkSaveChanges\n - BulkInsert\n - BulkUpdate\n - BulkDelete\n - BulkMerge\n - DeleteFromQuery\n - UpdateFromQuery\n\n```csharp\nvar context = new CustomerContext();\n// ... context code ...\n\n// Easy to use\ncontext.BulkSaveChanges();\n\n// Easy to customize\ncontext.BulkSaveChanges(operation =\u003e operation.BatchSize = 1000);\n```\n\n```csharp\n// Perform specific bulk operations\ncontext.BulkDelete(customers);\ncontext.BulkInsert(customers);\ncontext.BulkUpdate(customers);\n\n// Customize Primary Key\ncontext.BulkMerge(customers, operation =\u003e {\n   operation.ColumnPrimaryKeyExpression = customer =\u003e customer.Code;\n});\n```\n\n##### Scalable\nSQL Server - Benchmarks\n\n| Operations         | 100 Rows | 1,000 Rows | 10,000 Rows |\n| ------------------ | -------: | ---------: | ----------: |\n|**BulkSaveChanges** | 20 ms    | 200 ms     | 2,000 ms    |\n|**BulkInsert**      | 2 ms     | 6 ms       | 25 ms       |\n|**BulkUpdate**      | 27 ms    | 50 ms      | 80 ms       |\n|**BulkDelete**      | 25 ms    | 45 ms      | 70 ms       |\n|**BulkMerge**       | 30 ms    | 65 ms      | 160 ms      |\n\n##### Extensible\nSupport Multiple SQL Providers:\n- SQL Server 2008+\n- SQL Azure\n- SQL Compact\n- MySQL\n- SQLite\n- PostgreSQL\n- Oracle\n\n## Download\n\n### Entity Framework Core (EF Core)\n\u003ca href=\"https://www.nuget.org/packages/Z.EntityFramework.Extensions.EFCore/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/entity-framework-extensions-efcore-v.svg\" alt=\"download\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.nuget.org/packages/Z.EntityFramework.Extensions.EFCore/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/entity-framework-extensions-efcore-d.svg\" alt=\"\" /\u003e\u003c/a\u003e\n\n```\nPM\u003e Install-Package Z.EntityFramework.Extensions.EFCore\n```\n\n### Entity Framework 6 (EF6)\n\u003ca href=\"https://www.nuget.org/packages/Z.EntityFramework.Extensions/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/entity-framework-extensions-v.svg\" alt=\"download\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.nuget.org/packages/Z.EntityFramework.Extensions/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/entity-framework-extensions-d.svg\" alt=\"\" /\u003e\u003c/a\u003e\n\n```\nPM\u003e Install-Package Z.EntityFramework.Extensions\n```\n\n### Entity Framework 5 (EF5)\n\u003ca href=\"https://www.nuget.org/packages/Z.EntityFramework.Extensions.EF5/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/entity-framework-extensions-ef5-v.svg\" alt=\"download\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.nuget.org/packages/Z.EntityFramework.Extensions.EF5/\" target=\"_blank\"\u003e\u003cimg src=\"https://zzzprojects.github.io/images/nuget/entity-framework-extensions-ef5-d.svg\" alt=\"\" /\u003e\u003c/a\u003e\n\n```\nPM\u003e Install-Package Z.EntityFramework.Extensions.EF5\n```\n\n_* PRO Version unlocked for the current month_\n\n## BulkSaveChanges\n\n##### Problem\nYou need to save hundreds or thousands of entities, but you are not satisfied with Entity Framework performance.\n\n##### Solution\nBulkSaveChanges is exactly like SaveChanges but performs way faster. It’s easy to use, you only need to replace “SaveChanges” by “BulkSaveChanges”, and you are done!\n\n```\n// Upgrade SaveChanges performance with BulkSaveChanges\nvar context = new CustomerContext();\n// ... context code ...\n\n// Easy to use\ncontext.BulkSaveChanges();\n\n// Easy to customize\ncontext.BulkSaveChanges(operation =\u003e operation.BatchSize = 1000);\n```\n\n##### Scalability\nBulkSaveChanges is as fast as SaveChanges with one entity and quickly become **10-50x faster** with hundreds and thousands of entities.\n\n## Bulk Operations\n##### Problem\nYou need even more performance than BulkSaveChanges, save detached entities or save entities in a specific order.\n\n##### Solution\nUse bulk operations such as bulk insert, update, delete and merge which perform operations on specified entities and bypass the change tracker to increase performance.\n\n```csharp\n// Perform specific bulk operations on entities\ncontext.BulkDelete(customers);\ncontext.BulkInsert(customers);\ncontext.BulkUpdate(customers);\ncontext.BulkMerge(customers);\n```\n\n##### Maintainability\nBulk Operation directly uses the Entity Framework Model. Even if you change column name or change inheritance (TPC, TPH, TPT), Bulk Operation will continue to work as expected.\n\n## Custom Key\n##### Problem\nYou need to perform an update, delete, or merge using a specific custom key like the custom code.\n\n##### Solution\nSpecify your own key by customizing the operation.\n\n```csharp\n// Use flexible features such as specifying the primary key\ncontext.BulkMerge(customers, operation =\u003e {\n   operation.ColumnPrimaryKeyExpression = customer =\u003e customer.Code;\n});\n```\n\n##### Flexibility\nBulk operations offer hundreds of customization such as BatchSize, Custom Key, Custom Mapping, etc.\n\n## PRO Version\n_PRO Version unlocked for the current month_\n\nFeatures                    | [PRO Version](https://entityframework-extensions.net/#pro)\n--------                    | :-------------:\nBulk SaveChanges            | Yes\nBulk Insert                 | Yes\nBulk Update                 | Yes\nBulk Delete                 | Yes\nBulk Merge                  | Yes\nDeleteFromQuery             | Yes\nUpdateFromQuery             | Yes\nCommercial License          | Yes\nRoyalty-Free                | Yes\nSupport \u0026 Upgrades (1 year) | Yes\nLearn more about the **[PRO Version](https://entityframework-extensions.net/#pro)**\n\n## Contribute\n\nThe best way to contribute is by **spreading the word** about the library:\n\n - Blog it\n - Comment it\n - Star it\n - Share it\n \nA **HUGE THANKS** for your help.\n\n## More Projects\n\n- Projects:\n   - [EntityFramework Extensions](https://entityframework-extensions.net/)\n   - [Dapper Plus](https://dapper-plus.net/)\n   - [C# Eval Expression](https://eval-expression.net/)\n- Learn Websites\n   - [Learn EF Core](https://www.learnentityframeworkcore.com/)\n   - [Learn Dapper](https://www.learndapper.com/)\n- Online Tools:\n   - [.NET Fiddle](https://dotnetfiddle.net/)\n   - [SQL Fiddle](https://sqlfiddle.com/)\n   - [ZZZ Code AI](https://zzzcode.ai/)\n- and much more!\n\nTo view all our free and paid projects, visit our website [ZZZ Projects](https://zzzprojects.com/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzzprojects%2Fentityframework-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzzprojects%2Fentityframework-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzzprojects%2Fentityframework-extensions/lists"}