using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Sync;
using Umbraco.Extensions;
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(msgObject, type);
}