0
simedbn created
Hello,
I have an error when i want to send a notification :
ERROR 2018-01-22 18:58:10,334 [20 ] Mvc.ExceptionHandling.AbpExceptionFilter - Can not set TenantId to 0 for IMustHaveTenant entities!
Abp.AbpException: Can not set TenantId to 0 for IMustHaveTenant entities!
ࡁbp.EntityFrameworkCore.AbpDbContext.CheckAndSetMustHaveTenantIdProperty(Object entityAsObj)
ࡁbp.EntityFrameworkCore.AbpDbContext.ApplyAbpConceptsForAddedEntity(EntityEntry entry, Nullable`1 userId, EntityChangeReport changeReport)
ࡁbp.EntityFrameworkCore.AbpDbContext.ApplyAbpConcepts(EntityEntry entry, Nullable`1 userId, EntityChangeReport changeReport)
ࡁbp.EntityFrameworkCore.AbpDbContext.ApplyAbpConcepts()
public async Task SubscriptionAddedToMemberAsync(Member member, User user)
{
var notificationData = new LocalizableMessageNotificationData(
new LocalizableString(
"NewMemberSubscriptionAddedNotificationMessage",
MyAppConsts.LocalizationSourceName
)
);
notificationData["memberName"] = member.FirstName;
notificationData["userName"] = user.FullName;
await _notificationPublisher.PublishAsync(
AppNotificationNames.NewMemberSubscriptionAdded,
notificationData,
severity: NotificationSeverity.Warn,
excludedUserIds: new[] { user.ToUserIdentifier() });
}
But not On :
public async Task MemberDeletedAsync(Member member, User user)
{
var notificationData = new LocalizableMessageNotificationData(
new LocalizableString(
"MemberDeletedNotificationMessage",
MyAppConsts.LocalizationSourceName
)
);
notificationData["memberName"] = $"{member.FirstName} {member.LastName}";
notificationData["userName"] = user.FullName;
await _notificationPublisher.PublishAsync(
AppNotificationNames.MemberDeleted,
notificationData,
severity: NotificationSeverity.Warn,
excludedUserIds: new[] { user.ToUserIdentifier() });
}
Those methods are called from AppServices
Any Idea please !!
2 Answer(s)
-
0
Duplicate of #4206@1869b60c-666b-42bd-b275-2b83d023cc6f
Save changes before publishing a notification.
-
0
Hello,
Thank you @aaron :D