Files
Umbraco-CMS/src/Umbraco.PublishedCache.NuCache/Compose/NotificationsComposer.cs
Mole 8123fee867 Netcore: Migrate RepositoryBase and ContentTypeServiceBase events (#10141)
* Remove ScopeEntityRemove from ContentRepositoryBase and rely on "ing" notifications

* Remove old event handler from ContentEventsTests

* Remove ScopedVersionRemove from ContentRepositoryBase and rely on service notifications instead

* Remove unused ScopedVersionEventArgs from ContentRepositoryBase

* Migrate ScopeEntityRefresh to notification pattern

Unfortunately it's still published from the repository base

* Add simple content type notifications

* Publish Notifications instead of events in ContentTypeServiceBase for simple events

* Switch OnChanged to use Notifications for ContentTypeServices

* Publish notifications instead of raising ScopedRefreshedEntity on ContentTypeServiceBase

* Hook up to the new ContentType notifications

* Remove DistributedCacheBinderTests

There are no longer any events to really test on.

* Remove ContentTypeChange EventArgs

* Remove ContentService_Copied from DistributedCacheBinder

It's no longer used

* Cleanup

* Cleanup

* Removed uncommented code

* Fixed issue with unattented installs

* Re-add ContentTreeChangeNotification to DistributedCache

* Add new notification for ScopedEntityRemove

Marked as obsolete/hidden in editor, since this should only be used for nucache for now, and should really be changed in the future

* Mark Refresh notifications as obsolete/hidden

These should not be used anywhere outside Nucache, and should be changed to tree change at some point.

* Raise ScopedEntityRemoveNotification on repos and use in nucache

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 12:17:11 +02:00

24 lines
1.3 KiB
C#

using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Services.Notifications;
namespace Umbraco.Cms.Infrastructure.PublishedCache.Compose
{
public sealed class NotificationsComposer : ICoreComposer
{
public void Compose(IUmbracoBuilder builder) =>
builder
.AddNotificationHandler<LanguageSavedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MemberDeletingNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<ContentRefreshNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MediaRefreshNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MemberRefreshNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<ContentTypeRefreshedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MediaTypeRefreshedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MemberTypeRefreshedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<ScopedEntityRemoveNotification, PublishedSnapshotServiceEventHandler>()
;
}
}