public bool CheckAccessToChatroom(int givenRoomId, int givenUserId) { ChatroomContainer temp = containerMain; bool returnVal = default; foreach (Models.Chatroom variable in temp.Chatrooms) { if (variable.GetId() == givenRoomId) { returnVal = variable.CheckAccess(givenUserId); } } return(returnVal); }
ChatroomContainer containerMain; //= new ChatroomContainer(1); public AjaxController() { this.containerMain = new ChatroomContainer(1); this.containerMain.FetchRooms(); }