using System; using Umbraco.Cms.Core.Notifications; using Umbraco.Extensions; using Umbraco.Cms.Core.Sync; namespace Umbraco.Cms.Core.Cache { /// /// A that uses ActivatorUtilities to create the instances /// public sealed class CacheRefresherNotificationFactory : ICacheRefresherNotificationFactory { private readonly IServiceProvider _serviceProvider; public CacheRefresherNotificationFactory(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider; /// /// Create a using ActivatorUtilities /// /// The to create public TNotification Create(object msgObject, MessageType type) where TNotification : CacheRefresherNotification => _serviceProvider.CreateInstance(new object[] { msgObject, type }); } }