public ActionResult Inventory() { List <BranchModel> branches = new List <BranchModel>(); List <Branch> branches_raw = _branchService.GetBranchByCondition(b => b.BranchId != -1); foreach (var branch in branches_raw) { BranchModel br = new BranchModel(branch.Name, branch.Location); branches.Add(br); ViewData[branch.Name] = _stockService.GetStockModelByBranchId(branch.BranchId).countBooks(); } return(View(branches)); }