private async Task <bool> IsEnabledAsync(WebHookNotification body) { switch (body.Type) { case WebHookType.General: var webHook = await _webHookRepository.GetByIdAsync(body.WebHookId, o => o.Cache()).AnyContext(); return(webHook?.IsEnabled ?? false); case WebHookType.Slack: var project = await _projectRepository.GetByIdAsync(body.ProjectId, o => o.Cache()).AnyContext(); var token = project?.GetSlackToken(); return(token != null); } return(false); }