public async Task <ActionResult> PostMessage([FromBody] MessageDto messageDto) { var message = new Message { Name = messageDto.Name, Content = messageDto.Content, TimeStamp = DateTime.Now }; await _context.AddAsync(message); await _context.SaveChangesAsync(); return(Ok(message)); }
public IActionResult SendRequest([FromBody] MessageDto msg) { _hubContext.Clients.All.SendAsync("ReceiveOne", msg.user, msg.msgText); return(Ok()); }