18 lines
573 B
C#
18 lines
573 B
C#
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);
|
|
}
|
|
}
|