Files
Umbraco-CMS/src/Umbraco.Core/Events/NotificationExtensions.cs

18 lines
573 B
C#
Raw Normal View History

using System.Collections.Generic;
namespace Umbraco.Cms.Core.Events
{
public static class NotificationExtensions
{
public static T WithState<T>(this T notification, IDictionary<string, object> state) where T : IStatefulNotification
{
notification.State = state;
return notification;
}
public static T WithStateFrom<T, TSource>(this T notification, TSource source)
where T : IStatefulNotification where TSource : IStatefulNotification
=> notification.WithState(source.State);
}
}