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

18 lines
583 B
C#
Raw Normal View History

using System.Collections.Generic;
namespace Umbraco.Cms.Core.Notifications
{
public static class NotificationExtensions
{
public static T WithState<T>(this T notification, IDictionary<string, object?>? state) where T : IStatefulNotification
{
2022-02-28 13:14:02 +01:00
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);
}
}