Register notifications for DistributedCacheBinder

This commit is contained in:
Mole
2021-03-30 11:14:50 +02:00
parent 7b34b495af
commit 84d98f48c7
2 changed files with 11 additions and 3 deletions

View File

@@ -189,14 +189,18 @@ namespace Umbraco.Cms.Core.Cache
public void Handle(DataTypeSavedNotification notification)
{
foreach (var entity in notification.SavedEntities)
foreach (IDataType entity in notification.SavedEntities)
{
_distributedCache.RefreshDataTypeCache(entity);
}
}
public void Handle(DataTypeDeletedNotification notification)
{
foreach (var entity in notification.DeletedEntities)
foreach (IDataType entity in notification.DeletedEntities)
{
_distributedCache.RemoveDataTypeCache(entity);
}
}
#endregion

View File

@@ -78,7 +78,11 @@ namespace Umbraco.Cms.Core.Compose
.AddNotificationHandler<UserSavedNotification, DistributedCacheBinder>()
.AddNotificationHandler<UserDeletedNotification, DistributedCacheBinder>()
.AddNotificationHandler<UserGroupWithUsersSavedNotification, DistributedCacheBinder>()
.AddNotificationHandler<UserGroupDeletedNotification, DistributedCacheBinder>();
.AddNotificationHandler<UserGroupDeletedNotification, DistributedCacheBinder>()
.AddNotificationHandler<MemberGroupDeletedNotification, DistributedCacheBinder>()
.AddNotificationHandler<MemberGroupSavedNotification, DistributedCacheBinder>()
.AddNotificationHandler<DataTypeDeletedNotification, DistributedCacheBinder>()
.AddNotificationHandler<DataTypeSavedNotification, DistributedCacheBinder>();
// add notification handlers for auditing
builder