public async void SendNotification(List <Bet> betinvolved, string notificationType) { foreach (var item in betinvolved) { var userId = item.UserId; var usrername = await _accountService.GetusernamebyUserId(userId); var h = await _conser.getHconnectionId(usrername); var l = await _conser.getLconnectionId(usrername); RequestingUser RUser = new RequestingUser() { Username = usrername, }; await _OfferService.AddNotification(item, notificationType, RUser); if (h[0] != "") { foreach (var item2 in h) { await _BetSystemHub.Clients.Client(item2).SendAsync("newMatchedBet", item); } } if (l[0] != "") { foreach (var item2 in l) { await _LiveGameHub.Clients.Client(item2).SendAsync("newMatchedBet", item); } } } }