diff --git a/docs/en/Local-Event-Bus.md b/docs/en/Local-Event-Bus.md index 81c0c5a171..5c5d967f5f 100644 --- a/docs/en/Local-Event-Bus.md +++ b/docs/en/Local-Event-Bus.md @@ -235,6 +235,13 @@ Pre-build events are published when you save changes to the database; * For EF Core, they are published on `DbContext.SaveChanges`. * For MongoDB, they are published when you call repository's `InsertAsync`, `UpdateAsync` or `DeleteAsync` methods (since MongoDB has not a change tracking system). +#### AbpEntityChangeOptions + +There is a `PublishEntityUpdatedEventWhenNavigationChanges` option in the `AbpEntityChangeOptions` class with a default value of `true`. +If you set it to `false`, the `EntityUpdatedEventData` will not be published when a navigation property changes. + +> This option is only used for the EF Core. + ## See Also * [Distributed Event Bus](Distributed-Event-Bus.md) diff --git a/docs/zh-Hans/Local-Event-Bus.md b/docs/zh-Hans/Local-Event-Bus.md index 7a842a9e98..ebdb3f20a6 100644 --- a/docs/zh-Hans/Local-Event-Bus.md +++ b/docs/zh-Hans/Local-Event-Bus.md @@ -211,6 +211,14 @@ namespace AbpDemo * 对于 EF Core, 他们在 `DbContext.SaveChanges` 发布. * 对于 MongoDB, 在你调用仓储的 `InsertAsync`, `UpdateAsync` 或 `DeleteAsync` 方法发布(因为MongoDB没有更改追踪系统). + +#### AbpEntityChangeOptions + +`AbpEntityChangeOptions`类中有一个`PublishEntityUpdatedEventWhenNavigationChanges`选项,默认值为`true`。 +如果将其设置为`false`,则当导航属性更改时,将不会发布`EntityUpdatedEventData`事件。 + +> 此选项仅用于EF Core + ## 另请参阅 * [分布式事件总线](Distributed-Event-Bus.md) \ No newline at end of file diff --git a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs index 768a9ba171..8b59282cf1 100644 --- a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs +++ b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs @@ -76,14 +76,15 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems ConnectMethod.Invoke(this, Array.Empty()); } - protected virtual async Task ConnectAsync(CancellationToken token = default) + protected virtual async ValueTask ConnectAsync(CancellationToken token = default) { - if (GetRedisDatabase() != null) + var redisDatabase = GetRedisDatabase(); + if (redisDatabase != null) { - return; + return redisDatabase; } - await (Task)ConnectAsyncMethod.Invoke(this, new object[] { token })!; + return await (ValueTask)ConnectAsyncMethod.Invoke(this, new object[] { token })!; } public byte[]?[] GetMany(