Interface IAppNotificationStore
Interface for a data store that manages AppNotification objects.
Namespace: DataWeb.Notification
Assembly: DataWeb.Core.dll
Syntax
public interface IAppNotificationStore
Properties
Name
Gets the name of the data store.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
GetNotificationAsync(AppNotificationFilter, CancellationToken)
Retrieves a single AppNotification object that matches the specified filter criteria.
Declaration
Task<AppNotification> GetNotificationAsync(AppNotificationFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
AppNotificationFilter | filter | The AppNotificationFilter criteria to use. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<AppNotification> | A task representing the asynchronous retrieval operation. |
GetNotificationCountAsync(AppNotificationFilter, CancellationToken)
Retrieves the count of AppNotification objects that match the specified filter criteria.
Declaration
Task<long> GetNotificationCountAsync(AppNotificationFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
AppNotificationFilter | filter | The AppNotificationFilter criteria to use. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | A task representing the asynchronous count operation. |
GetNotificationsAsync(AppNotificationFilter, CancellationToken)
Retrieves a collection of AppNotification objects that match the specified filter criteria.
Declaration
Task<IEnumerable<AppNotification>> GetNotificationsAsync(AppNotificationFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
AppNotificationFilter | filter | The AppNotificationFilter criteria to use. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<AppNotification>> | A task representing the asynchronous retrieval operation. |
RemoveAsync(string, CancellationToken)
Removes a notification with the specified notificationId.
Declaration
Task RemoveAsync(string notificationId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | notificationId | The Id of the notification to remove. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous remove operation. |
RemoveToDateAsync(DateTime, string, bool, CancellationToken)
Removes all notifications with a notification date before or equal to the specified toDate and context.
Declaration
Task RemoveToDateAsync(DateTime toDate, string context, bool includeNotRead = false, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DateTime | toDate | The maximum date for the notifications to remove. |
string | context | The context of the notifications to remove. |
bool | includeNotRead | Whether to include notifications that have not been read. Defaults to false. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous remove operation. |
SetAsync(AppNotification, CancellationToken)
Saves an AppNotification object to the data store.
Declaration
Task SetAsync(AppNotification notification, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
AppNotification | notification | The AppNotification object to save. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous save operation. |
SetIsReadAsync(string, bool, CancellationToken)
Sets the read status of a notification with the specified notificationId.
Declaration
Task SetIsReadAsync(string notificationId, bool isRead = true, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | notificationId | The Id of the notification to update. |
bool | isRead | The new read status. Defaults to true. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous update operation. |
SetUserIsReadAllAsync(string, string, bool, CancellationToken)
Sets the read status of all notifications for a user with the specified userIdMaster and context.
Declaration
Task SetUserIsReadAllAsync(string userIdMaster, string context, bool isRead = true, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | userIdMaster | The user identifier. |
string | context | The context of the notifications to update. |
bool | isRead | The new read status. Defaults to true. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous update operation. |