public IHttpActionResult GetAllCategory(int userID) { int userid = userID; var categorys = _categoryBs.CategoryList(); var UserCategory = _userCategoryBs.UserCategoryList().Where(x => x.UserID == userid).Select(x => x).ToList(); categorys.ForEach(x => { x.IsChecked = UserCategory.Any(z => z.UserID == userid && z.CategoryID == x.Id && z.IsSelected == true); }); apiResponse.Data = categorys; apiResponse.IsSuccess = true; return(Ok(apiResponse)); }
// GET: Admin/Master public ActionResult Index() { var category = _categoryBs.CategoryList(); return(View(category)); }