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

0

本文介绍了是否有 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 的非商业替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

参数计数与调用不匹配?
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)...
2023-11-11 C#/.NET开发问题
26

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

没有 EndInvoke 的 C# 异步调用?
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)...
2023-11-11 C#/.NET开发问题
2

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14