public ActionResult EditLibrary(int specid = 0) { int qsSpecId = specid; MyLibraryModel MainMyLibraryModel = new MyLibraryModel(); var UserSpecialityList = MyLibraryBL.GetUserSpecialities(CurrentUser.UserId); if (qsSpecId == 0) { qsSpecId = UserSpecialityList.Select(n => n.SpecialityId).FirstOrDefault(); } var UserFolderList = MyLibraryBL.GetUserFolderListEdit(qsSpecId, CurrentUser.UserId); MainMyLibraryModel.AllUserFoldersEdit = UserFolderList; MainMyLibraryModel.AllUserSpecialities = UserSpecialityList; MainMyLibraryModel.HiddenTopicIds = MyLibraryBL.GetHiddenTopicIds(CurrentUser.UserId); MainMyLibraryModel.HiddenSubTopicIds = MyLibraryBL.GetHiddenSubTopicIds(CurrentUser.UserId); ViewBag.SpecId = qsSpecId; ViewBag.DefaultSpecId = UserSpecialityList.Select(n => n.SpecialityId).FirstOrDefault(); return(View(MainMyLibraryModel)); }