public async Task SetAllNotificationsAsRead() { await _userNotificationManager.UpdateAllUserNotificationStatesAsync(AbpSession.ToUserIdentifier(), UserNotificationState.Read); }
/// <summary> /// Updates all notification states for a user. /// </summary> /// <param name="userNotificationManager">User notificaiton manager</param> /// <param name="user">User.</param> /// <param name="state">New state.</param> public static void UpdateAllUserNotificationStates(this IUserNotificationManager userNotificationManager, UserIdentifier user, UserNotificationState state) { AsyncHelper.RunSync(() => userNotificationManager.UpdateAllUserNotificationStatesAsync(user, state)); }
public async Task MarkAllAsReaded(long userId) { var userIdentifier = new UserIdentifier(1, userId); await _userNotificationManager.UpdateAllUserNotificationStatesAsync(userIdentifier, UserNotificationState.Read); }
public async Task UpdateStatesAsync([NotNull] UserNotificationState state) { await _userNotificationManager.UpdateAllUserNotificationStatesAsync(CurrentUser.Id.Value, state); }
/// <summary> /// 将所有通知置为已读 /// </summary> public async Task SetAllNotificationsAsRead() { var currentUserId = AbpSession.ToUserIdentifier(); await _userNotificationManager.UpdateAllUserNotificationStatesAsync(currentUserId, UserNotificationState.Read); }