This commit is contained in:
@@ -37,22 +37,30 @@ namespace AyaNova.Biz
|
||||
await AddEvent(new NotifyEvent() { EventType = NotifyEventType.ServerOperationsProblem, Message = message });
|
||||
}
|
||||
|
||||
|
||||
public static async Task AddEvent(NotifyEvent ev)
|
||||
//Add event if there are subscribers
|
||||
public static async Task AddEvent(NotifyEvent ev, List<string> inTags = null)
|
||||
{
|
||||
|
||||
log.LogTrace($"AddEvent processing: [{ev.ToString()}]");
|
||||
try
|
||||
{
|
||||
|
||||
log.LogTrace("Notify set to RUNNING state and starting now");
|
||||
List<NotifySubscription> subs = new List<NotifySubscription>();
|
||||
|
||||
|
||||
using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext)
|
||||
{
|
||||
//iterate subs, figure out who gets this event
|
||||
//add to table for any that do
|
||||
var subs=await ct.NotifySubscription.AsNoTracking().Where(z=>z.EventType==ev.EventType &&)
|
||||
if (inTags == null || inTags.Count==0)
|
||||
{
|
||||
//No tags
|
||||
subs = await ct.NotifySubscription.AsNoTracking().Where(z => z.EventType == ev.EventType && z.AyaType == ev.AyaType).ToListAsync();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//In tags
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user