Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a non-commercial alternative to Z.EntityFramework.Extensions? [closed]

Entity Framework can be very slow on mass insert/update/delete operations. Even the often suggested tweaks to turn off AutoDetectChanges and/or ValidateOnSaveEnabled does not always help.

I have come across the Z.EntityFramework.Extensions on NuGet, but it seems to be a commercial product, which will only work for a certain period of time.

https://www.nuget.org/packages/Z.EntityFramework.Extensions/

So far, I really only need BulkInsert(), BulkUpdate() and BulkDelete().

My question is:

Is there any reliable non-commercial library, that does nearly the same as Z.EntityFramework.Extensions?

Thanks for any hints!

like image 506
Michael Avatar asked Feb 20 '17 13:02

Michael


1 Answers

Disclaimer: I'm the owner of Entity Framework Extensions

You are right. This is a commercial product.

Every month, a free trial is available, but you will have to purchase the product for the production environment.

Bulk Insert

For BulkInsert, there are some free alternatives but be careful, they don't support all inheritances & associations and are no longer supported:

  • https://www.nuget.org/packages/EntityFramework.BulkInsert-ef6
  • https://github.com/MikaelEliasson/EntityFramework.Utilities

Disclaimer: I'm the owner of Entity Framework Plus

For Batch Update && Batch Delete, you can use this library:

// DELETE all users which has been inactive for 2 years
ctx.Users.Where(x => x.LastLoginDate < DateTime.Now.AddYears(-2))
         .Delete();

// UPDATE all users which has been inactive for 2 years
ctx.Users.Where(x => x.LastLoginDate < DateTime.Now.AddYears(-2))
         .Update(x => new User() { IsSoftDeleted = 1 });
like image 119
Jonathan Magnan Avatar answered Oct 08 '22 18:10

Jonathan Magnan