是否有 Z.EntityFramework.Extensions 的非商业替代品?

Is there a non-commercial alternative to Z.EntityFramework.Extensions?(是否有 Z.EntityFramework.Extensions 的非商业替代品?)
本文介绍了是否有 Z.EntityFramework.Extensions 的非商业替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实体框架在批量插入/更新/删除操作时可能会非常慢.即使是经常建议的关闭 AutoDetectChanges 和/或 ValidateOnSaveEnabled 的调整也并不总是有帮助.

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.

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

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/

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

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

我的问题是:

是否有任何可靠的非商业库,其功能与 Z.EntityFramework.Extensions 几乎相同?

感谢任何提示!

推荐答案

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

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

You are right. This is a commercial product.

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

批量插入

对于 BulkInsert,有一些免费的替代方案,但要小心,它们不支持所有继承 &关联并且不再受支持:

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

免责声明:我是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 的非商业替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)