This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user