Z.EntityFramework.Extensions是否有非商业替代方案? [英] Is there a non-commercial alternative to Z.EntityFramework.Extensions?

查看:201
本文介绍了Z.EntityFramework.Extensions是否有非商业替代方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实体框架在批量插入/更新/删除操作上可能会非常慢.甚至经常建议的关闭自动检测更改和/或ValidateOnSaveEnabled的调整措施也总是无济于事.

我在NuGet上遇到过Z.EntityFramework.Extensions,但它似乎是一种商业产品,只能在特定时间段内工作.

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

到目前为止,我真的只需要BulkInsert(),BulkUpdate()和BulkDelete().

我的问题是:

是否存在与Z.EntityFramework.Extensions几乎相同的可靠非商业类库?

感谢任何提示!

解决方案

免责声明:我是实体框架扩展

你是对的.这是一种商业产品.

每个月都有免费试用版,但是您必须为生产环境购买产品.

批量插入

对于BulkInsert,有一些免费的替代方案,但请注意,它们不支持所有继承.关联,不再受支持:

免责声明:我是 Entity Framework Plus

对于批处理更新&&批量删除,您可以使用此库:

 //删除所有已停用2年的用户ctx.Users.Where(x => x.LastLoginDate< DateTime.Now.AddYears(-2)).删除();//更新所有已停用2年的用户ctx.Users.Where(x => x.LastLoginDate< DateTime.Now.AddYears(-2)).Update(x => new User(){IsSoftDeleted = 1}); 

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!

解决方案

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:

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

这篇关于Z.EntityFramework.Extensions是否有非商业替代方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆