public async Task <IActionResult> UpdateResponseUI([FromBody] ResponseUIModel responseUIUpdate) { if (responseUIUpdate.Response == null && responseUIUpdate.ResponseId != Guid.Empty) { responseUIUpdate.Response = await _responseDataManager.GetResponse(responseUIUpdate.ResponseId); } await _hub.Clients.All.SendAsync("UpdateResponseUI", responseUIUpdate); return(Ok()); }
public async Task <bool> UpdateResponseUI(ResponseUIModel responseUIUpdate) { RestRequest request = await PrepareQuery("SignalR/Response", Method.PUT); request.AddParameter("application/json", JsonConvert.SerializeObject(responseUIUpdate), ParameterType.RequestBody); var queryResult = await _client.ExecuteTaskAsync(request); if (!queryResult.IsSuccessful) { _logger.LogError($"UpdateResponseUI: Error while sending a message: {queryResult.StatusCode}"); return(false); } return(true); }