This commit is contained in:
2020-07-16 23:48:56 +00:00
parent ee987193d7
commit 371684e510

View File

@@ -83,10 +83,15 @@ namespace AyaNova.Biz
}
//check subscriptions for event and send accordingly
var subs = ct.NotifySubscription.Where(z => z.EventType == eventType)
//check subscriptions for event and send accordingly to each user
var subs = await ct.NotifySubscription.Where(z => z.EventType == eventType).ToListAsync();
foreach (var sub in subs)
{
NotifyEvent n = new NotifyEvent() { EventType = eventType, UserId = sub.UserId, Message = message, SubscriptionId = sub.Id };
await ct.NotifyEvent.AddAsync(n);
}
if (subs.Count > 0)
await ct.SaveChangesAsync();
}
}