public async Task SendComment(CreateComment.Command command) { var comment = await _mediator.Send(command); await Clients.Group(command.ActivityId.ToString()) .SendAsync("ReceiveComment", comment.Value); }
public async Task <IActionResult> CreateAsync([FromBody] CreateCommentRequest comment) { var getQuery = new CreateComment.Command(comment); var res = await _mediator.Send(getQuery); return(Ok(true)); }
public async Task SendComment(CreateComment.Command command) { var username = Context.User?.Claims?.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier)?.Value; command.Username = username; var comment = await _mediator.Send(command); await Clients.Group(command.ClubId.ToString()).SendAsync("ReceivedComment", comment); }
public async Task SendComment(CreateComment.Command command) { var username = GetUsername(); command.Username = username; var comment = await _mediator.Send(command); await Clients.Group(command.TrainingClassesId.ToString()).SendAsync("ReceiveComment", comment); }
public async Task <ActionResult <Unit> > CreateComment(CreateComment.Command command) { return(await _mediator.Send(command)); }
public async Task <IActionResult> CreateComment([FromBody] CreateComment.Command command) { return(Ok(await _mediator.Send(command))); }