Provides utility functions for handling notifications-related operations.
More...
Provides utility functions for handling notifications-related operations.
◆ Notification()
BetterFinds.Utils.Notification.Notification |
( |
IConfiguration |
configuration | ) |
|
Initializes a new instance of the Notification class.
- Parameters
-
configuration | The IConfiguration instance. |
◆ CreateNotification()
void BetterFinds.Utils.Notification.CreateNotification |
( |
int |
clientId, |
|
|
int |
auctionId, |
|
|
string |
message |
|
) |
| |
|
inline |
Creates a new notification for the specified client.
Creates and inserts a new notification into the database.
A notification has the following properties:
-
NotificationId: The unique identifier of the notification.
-
Message: The message content of the notification.
-
Timestamp: The timestamp of the notification.
-
ClientId: The ClientId of the client.
-
AuctionId: The AuctionId of the auction related to the notification.
-
IsRead: A boolean value indicating whether the notification has been read. Default value: false.
- Parameters
-
clientId | ClientId of the client. |
auctionId | AuctionId of the auction related to the notification. |
message | The message content of the notification. |
◆ GetNotifications()
List<Dictionary<string, object> > BetterFinds.Utils.Notification.GetNotifications |
( |
int |
clientId | ) |
|
|
inline |
Returns a dictionary list of notifications for a specific client.
- Parameters
-
clientId | The ClientId of the client. |
This method is used to display the notifications in the Pages.NotificationsModel page.
The dictionary returned by this method contains the following keys:
{
"NotificationId": int,
"Message": string,
"Timestamp": DateTime,
"IsRead": bool,
"AuctionId": int,
"ProductName": string,
"ProductPrice": decimal
}
- Returns
- A dictionary list of notifications for a specific client.
◆ GetNotificationsCount()
int BetterFinds.Utils.Notification.GetNotificationsCount |
( |
int |
clientId | ) |
|
|
inline |
Returns the total number of notifications for a specific client.
Currently not being used.
- Parameters
-
clientId | The ClientId of the client. |
- Returns
- The total number of notifications for a specific client.
◆ GetUnreadNotificationsCount()
int BetterFinds.Utils.Notification.GetUnreadNotificationsCount |
( |
int |
clientId | ) |
|
|
inline |
Returns the number of unread notifications for a specific client.
This method is used to display the number of unread notifications in the navbar.
- Parameters
-
clientId | The ClientId of the client. |
- Returns
- The number of unread notifications for a specific client.
◆ MarkAllAsRead()
void BetterFinds.Utils.Notification.MarkAllAsRead |
( |
int |
clientId | ) |
|
|
inline |
Marks all notifications as read. Used in the Pages.NotificationsModel page.
- Parameters
-
clientId | The ClientId of the client to mark all notifications as read. |
◆ MarkAsRead()
void BetterFinds.Utils.Notification.MarkAsRead |
( |
int |
clientId, |
|
|
int |
notificationId |
|
) |
| |
|
inline |
Marks a notification as read. Used in the Pages.NotificationsModel page.
- Parameters
-
clientId | The ClientId of the client to mark the notification as read. |
notificationId | The NotificationId of the notification to mark as read. |
◆ configuration
readonly IConfiguration BetterFinds.Utils.Notification.configuration |
|
private |
The IConfiguration instance.
The documentation for this class was generated from the following file:
- BetterFinds/Utils/Notification.cs