// Get all WebHooks of a User for an Action. It is used to send Notifications against all actions of a User public override async Task <ICollection <WebHook> > QueryWebHooksAsync(string user, IEnumerable <string> actions, Func <WebHook, string, bool> predicate) { if (user == null) { throw new ArgumentNullException(nameof(user)); } user = NormalizeKey(user); predicate = predicate ?? DefaultPredicate; try { var registrations = await _webHookRepository.GetMany <Registration>(user); ICollection <WebHook> matches = registrations.Select(r => ConvertToWebHook(r)).Where(w => (MatchesAnyAction(w, actions) && predicate(w, user))).ToArray(); return(matches); } catch (Exception ex) { var message = string.Format(CultureInfo.CurrentCulture, Constants.Constants.OperationFailed, "Get", ex.Message); _logger.Error(message, ex); throw new InvalidOperationException(message, ex); } }