public async Task SendPrivateOffer(string userName, Send.Command command) { var userNameId = Context.User.Claims.First(x => x.Type == "_unid").Value; if (userName != userNameId) { var result = await mediator.Send(command); await Clients.User(userName).SendAsync("ReceiveOffer", result); } }
public async Task SendComment(string groupName, string userName, Send.Command comment) { var userNameId = Context.User.Claims.First(x => x.Type == "_unid").Value; if (userName != userNameId) { // to not send to him self // the comment will be added to DOM with NgRx // or u can remove this 'conditional statement' var result = await mediator.Send(comment); await Clients.Group(groupName).SendAsync("ReceiveComment", result); } }