I have Notifications working in a .NET Core web application. However I'm trying to understand the Entity Notification operation. As I read the documentation and tried few coding some scenarios it doesn't seem to be working as I thought it might. My application has a Table for "Parcels". I created a Subscription based on one of the Parcels listed in the table
await _notificationSubscriptionManager
.SubscribeAsync(new UserIdentifier(tenantId, userId), "ParcelTransfer", new EntityIdentifier(typeof(Parcel), 3041));
The Id Value I used is the Id value for a Parcel in the Parcel database table. The code then then fires a publish call but uses a different Parcel Id value
await _notificationPublisher.PublishAsync(notificationName, data: new MessageNotificationData(message),
new EntityIdentifier(typeof(Parcel), 3042), userIds: userIds);
However, I still receive a Notification. I thought because I issued the Publish call using a different Parcel Identity Id value, a Notification would NOT be sent. I'm thinking I don't understand how the process works.
Figured it out. I didn't need to specify an
EntityIdentifierobject in thePublishAsync()method. The fact the User with a Tenant and UserId was specified in the SubscriptionSubscribeAsync()method was all I needed.When the publish command was issued, the code just needed to look at the Subscriptions based on the subscription name.
I also had to modify my EmailRealTimeNotifier class for both methods
SendNotifications()andSendNotificationsAsync()to