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

拜拜、爱过 提交于 2021-01-21 03:44:12

问题


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!


回答1:


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 });


来源:https://stackoverflow.com/questions/42345300/is-there-a-non-commercial-alternative-to-z-entityframework-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!