예제 #1
0
        public async Task DeleteNotification(EntityDto <Guid> input)
        {
            var notification = await _userNotificationManager.GetUserNotificationAsync(AbpSession.TenantId, input.Id);

            if (notification.UserId != AbpSession.GetUserId())
            {
                throw new UserFriendlyException(L("ThisNotificationDoesntBelongToYou"));
            }

            await _userNotificationManager.DeleteUserNotificationAsync(AbpSession.TenantId, input.Id);
        }
예제 #2
0
 /// <summary>
 /// 删除通知
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 public async Task DeleteNotification(EntityDto <Guid> input)
 {
     await _userNotificationManager.DeleteUserNotificationAsync(AbpSession.TenantId, input.Id);
 }
 /// <summary>
 /// Deletes a user notification.
 /// </summary>
 /// <param name="userNotificationManager">User notificaiton manager</param>
 /// <param name="tenantId">Tenant Id</param>
 /// <param name="userNotificationId">The user notification id.</param>
 public static void DeleteUserNotification(this IUserNotificationManager userNotificationManager, int?tenantId, Guid userNotificationId)
 {
     AsyncHelper.RunSync(() => userNotificationManager.DeleteUserNotificationAsync(tenantId, userNotificationId));
 }
예제 #4
0
 public async Task DeleteAsync([NotNull] Guid notificationId)
 {
     await _userNotificationManager.DeleteUserNotificationAsync(CurrentUser.Id.Value, notificationId);
 }