Class NotificationExtensions
Provides extension methods for notifications to support state transfer.
Inheritance
object
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public static class NotificationExtensions
Methods
View SourceWithStateFrom<T, TSource>(T, TSource)
Copies the state from a source notification to the target notification.
Declaration
public static T WithStateFrom<T, TSource>(this T notification, TSource source) where T : IStatefulNotification where TSource : IStatefulNotification
Parameters
| Type | Name | Description |
|---|---|---|
| T | notification | The notification to set state on. |
| TSource | source | The source notification to copy state from. |
Returns
| Type | Description |
|---|---|
| T | The notification with state copied, for method chaining. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of target notification. |
| TSource | The type of source notification. |
WithState<T>(T, IDictionary<string, object?>?)
Sets the state dictionary on a stateful notification.
Declaration
public static T WithState<T>(this T notification, IDictionary<string, object?>? state) where T : IStatefulNotification
Parameters
| Type | Name | Description |
|---|---|---|
| T | notification | The notification to set state on. |
| IDictionary<string, object> | state | The state dictionary to set. |
Returns
| Type | Description |
|---|---|
| T | The notification with state set, for method chaining. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of notification. |