Open rukshanfonseka opened 2 years ago
Ok after much trolling through the library code this works
// this can be used outside of a MVC or WebAPI controller
public static async Task NotifyAsync(string action, object data)
{
var logger = CommonServices.GetLogger();
var store = CustomServices.GetStore();
var sender = CustomServices.GetSender(logger);
var manager = new WebHookManager(store, sender, logger);
var notifications = new NotificationDictionary[] { new NotificationDictionary(action, data) };
await manager.NotifyAllAsync(notifications, null);
}
Can someone let me know if it is possible to call the custom webhook's NotifyAsync outside of a MVC or WebApi controller? I already send webhooks within controllers but now also need to add NotifyAsync to a WCF callback. I cannot see how I can get access to the Web hook manager.