public async Task <IActionResult> SendMessage(MessageInputDataModel model) { if (ModelState.IsValid) { var messageSend = await _messageServices.SendMessage(model); if (!messageSend.Status) { return(RedirectToAction("Create")); } string JsonContext = JsonConvert.SerializeObject(messageSend, Formatting.Indented, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); await _hubContext.Clients.All.SendAsync("Message", JsonContext); return(Ok()); } return(BadRequest()); }
public IHttpActionResult Send([FromBody] InputSendMessage input) { var result = _messageServices.SendMessage(input); return(Ok(result)); }