API.SignalR.ChatHub.SendComment C# (CSharp) Method

SendComment() public method

public SendComment ( Create.Command command ) : Task
command Create.Command
return Task
        public async Task SendComment(Create.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.All.SendAsync("ReceiveComment", comment);
        }
    }