public async Task SendChannelMessage(string channelId, string content, List<IFormFile> attachments = null) { var authorId = Context.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value; var result = await messageRepository.CreateChannelMessageAsync(authorId, channelId, content, attachments); if (!result.Success) { await Clients.User(authorId).SendAsync("UploadError", result.Message); return; } await Clients.Group(channelId).SendAsync("ReceiveChannelMessage", content); }
CreateChannelMessageAsync