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

18 lines
581 B
C#
Raw Normal View History

using System.Collections.Generic;
namespace Umbraco.Cms.Core.Notifications
{
public static class NotificationExtensions
{
2022-02-16 16:03:53 +01:00
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);
}
}