public ActionResult Users(Guid?Id) { GetUserModel getUserNull = new GetUserModel(); getUserNull = null; try { chatService = new WebChatService.ChatServiceClient(); var room = chatService.GetRoomList().FirstOrDefault(x => x.Id == Id); WebChatService.User logUser = new WebChatService.User(); logUser.UserName = (Session["UserData"] as LoginUserModel).UserName; logUser.Id = (Session["UserData"] as LoginUserModel).Id; var users = chatService.JoinRoom(room, logUser); return(View(new GetUserModel() { getUser = users, RoomID = Id })); } catch (Exception) { return(View(getUserNull)); } }
public ActionResult Rooms() { chatService = new WebChatService.ChatServiceClient(); var rooms = chatService.GetRoomList().ToList(); if (rooms.Count() == 0) { GetRoomListModel getRoom = new GetRoomListModel(); getRoom = null; return(View(getRoom)); } else { return(View(new GetRoomListModel() { roomList = rooms })); } }