private void SendRooms(bool broadcast = false) { List <Room> roomList = roomDao.All(); if (broadcast) { Sessions.Broadcast(JsonConvert.SerializeObject(new { type = RoomActions.UPDATE_ROOMS, rooms = roomList })); } else { Send(JsonConvert.SerializeObject(new { type = RoomActions.UPDATE_ROOMS, rooms = roomList })); } }
public ActionResult Index() { return(Json(roomDAO.All(), JsonRequestBehavior.AllowGet)); }