private void SendMessage() { ChatMessageViewModel newMessage = new ChatMessageViewModel() { Content = _newMessage, IsBusy = true, UserName = _userName }; Messages.Add(newMessage); ChatMessage message = new ChatMessage() { Content = _newMessage, UserName = _userName, }; NewMessage = null; newMessage.Key = RealtimeService.SendMessage(message); }
// this is just here to show AddAgentToEngagement // can be called from the api or the engagement hub connect event. //public async Task<IHttpActionResult> JoinAgent() //{ // await _realtimeService.AddAgentToEngagementAsync(1, "engagement-1"); // return StatusCode(HttpStatusCode.NoContent); //} public async Task <IHttpActionResult> Post() { await _realtimeService.SendMessage(); return(StatusCode(HttpStatusCode.NoContent)); }