示例#1
0
        public async Task SendComment(CreateComment.Command command)
        {
            var comment = await _mediator.Send(command);

            await Clients.Group(command.ActivityId.ToString())
            .SendAsync("ReceiveComment", comment.Value);
        }
示例#2
0
        public async Task <IActionResult> CreateAsync([FromBody] CreateCommentRequest comment)
        {
            var getQuery = new CreateComment.Command(comment);
            var res      = await _mediator.Send(getQuery);

            return(Ok(true));
        }
示例#3
0
        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);
        }
示例#4
0
        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)));
 }