Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to send notification in Do Work #5295


User avatar
0
velu created

Hi,

How to send the notification to users in do work method.

Thanks.


4 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    hi,

    here's the Notification document <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Notification-System">http://www.aspnetboilerplate.com/Pages/ ... ion-System</a>

  • User Avatar
    0
    velu created

    Hi,

    We already implemented this logic in the simple task with session.

    but we have some difficulties in sending notification in Do Work method. ---- we achieve this using session overwrite method

    But in my case <span style="color:#FF0000">notification insert twice </span>in the abptenantnotifications and abpusernotifications table.

    Following code is for sending notification in .netCore 1.1;

    using (_unitOfWorkManager.Current.SetTenantId(null))
                {
                    await _notificationPublisher.PublishAsync(
                   notificationName,
                   new MessageNotificationData(message),
                   severity: NotificationSeverity.Info,
                   tenantIds: new[] { user.TenantId }
                   );
                    //await _unitOfWorkManager.Current.SaveChangesAsync();
                }
    

    You give this solution when notifications are not able to publish.

    Can you give me any fix for That?

    Thanks.

  • User Avatar
    0
    velu created

    Hi,

    This problem is solved.

    using session overwrite

    Thanks :D

  • User Avatar
    0
    ismcagdas created
    Support Team

    @velu Great :)