Search Results for

    Show / Hide Table of Contents
    View Source

    Interface INotificationsRepository

    Represents a repository for Notification entities.

    Namespace: Umbraco.Cms.Core.Persistence.Repositories
    Assembly: Umbraco.Core.dll
    Syntax
    public interface INotificationsRepository : IRepository

    Methods

    View Source

    DeleteNotifications(IEntity)

    Deletes all notifications for an entity.

    Declaration
    int DeleteNotifications(IEntity entity)
    Parameters
    Type Name Description
    IEntity entity

    The entity whose notifications should be deleted.

    Returns
    Type Description
    int

    The number of notifications deleted.

    View Source

    DeleteNotifications(IUser)

    Deletes all notifications for a user.

    Declaration
    int DeleteNotifications(IUser user)
    Parameters
    Type Name Description
    IUser user

    The user whose notifications should be deleted.

    Returns
    Type Description
    int

    The number of notifications deleted.

    View Source

    DeleteNotifications(IUser, IEntity)

    Deletes all notifications for a specific user and entity combination.

    Declaration
    int DeleteNotifications(IUser user, IEntity entity)
    Parameters
    Type Name Description
    IUser user

    The user.

    IEntity entity

    The entity.

    Returns
    Type Description
    int

    The number of notifications deleted.

    View Source

    GetEntityNotifications(IEntity)

    Gets all notifications for an entity.

    Declaration
    IEnumerable<Notification> GetEntityNotifications(IEntity entity)
    Parameters
    Type Name Description
    IEntity entity

    The entity to get notifications for.

    Returns
    Type Description
    IEnumerable<Notification>

    A collection of notifications.

    View Source

    GetUserNotifications(IUser)

    Gets all notifications for a user.

    Declaration
    IEnumerable<Notification> GetUserNotifications(IUser user)
    Parameters
    Type Name Description
    IUser user

    The user to get notifications for.

    Returns
    Type Description
    IEnumerable<Notification>

    A collection of notifications.

    View Source

    GetUsersNotifications(IEnumerable<int>, string?, IEnumerable<int>, Guid)

    Gets notifications for multiple users, filtered by action, node IDs, and object type.

    Declaration
    IEnumerable<Notification> GetUsersNotifications(IEnumerable<int> userIds, string? action, IEnumerable<int> nodeIds, Guid objectType)
    Parameters
    Type Name Description
    IEnumerable<int> userIds

    The user identifiers.

    string action

    The action to filter by, or null for all actions.

    IEnumerable<int> nodeIds

    The node identifiers to filter by.

    Guid objectType

    The object type to filter by.

    Returns
    Type Description
    IEnumerable<Notification>

    A collection of notifications.

    View Source

    SetNotifications(IUser, IEntity, string[])

    Sets the notifications for a user and entity, replacing any existing notifications.

    Declaration
    IEnumerable<Notification> SetNotifications(IUser user, IEntity entity, string[] actions)
    Parameters
    Type Name Description
    IUser user

    The user.

    IEntity entity

    The entity.

    string[] actions

    The actions to set notifications for.

    Returns
    Type Description
    IEnumerable<Notification>

    A collection of the created notifications.

    View Source

    TryCreateNotification(IUser, IEntity, string, out Notification?)

    Tries to create a notification for a user and entity.

    Declaration
    bool TryCreateNotification(IUser user, IEntity entity, string action, out Notification? notification)
    Parameters
    Type Name Description
    IUser user

    The user to create the notification for.

    IEntity entity

    The entity related to the notification.

    string action

    The action that triggered the notification.

    Notification notification

    When successful, contains the created notification.

    Returns
    Type Description
    bool

    true if the notification was created successfully; otherwise, false.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX