示例#1
0
        public async Task SendComment(Application.Comments.Create.Command command)
        {
            string userName = GetUserName();

            command.UserName = userName;

            var comment = await _mediator.Send(command);

            //send comment to any client connected to group after comment has been added to DB
            await Clients.Group(command.ActivityId.ToString()).SendAsync("ReceiveComment", comment);
        }
 public async Task <ActionResult <CommentDto> > PostComment(Application.Comments.Create.Command command)
 {
     return(await this.Mediator.Send(command));
 }