Exemple #1
0
        public void CreateChatRoom(string useralias,
                                   string roomName,
                                   string password,
                                   int maxUser,
                                   bool needPassword)
        {
            if (maxUser < 2)
            {
                maxUser = 2;
            }

            Guid roomid = ChatManager.CreateChatRoom(
                roomName, password, false, maxUser, needPassword);
        }
Exemple #2
0
 public async Task <IHttpActionResult> CreateRoom(ChatRoomDto room)
 {
     try
     {
         if (ModelState.IsValid)
         {
             return(Ok(await _chatManager.CreateChatRoom(room)));
         }
         else
         {
             return(BadRequest(ModelState));
         }
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }