private async Task <Chatroom> CreateOrUpdate(Chatroom chatroom) { try { _chatroomRepository.CreateOrUpdateChatroom(chatroom); } catch (ChatroomUpdateException) { _chatroomRepository.CreateOrUpdateChatroom(chatroom); } await SendCreateChatroomMessage(chatroom); return(_chatroomRepository.GetChatroomById(chatroom.Id)); }
public IHttpActionResult GetChatroom([FromUri] int id) { var chatroom = _chatroomRepository.GetChatroomById(id); return(Ok(chatroom)); }