public ActionResult ManagePolicies() { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); var viewModel = new CategoryVM(); viewModel.CategoryList = grinder.GetAllCategoryies(); return(View(viewModel)); }
public ActionResult ManagePolicies(int categoryId) { PolicyGrinder grinder = PolicyGrinderFactory.Synthesize(); var viewModel = new CategoryVM(); var categoryList = grinder.GetAllCategoryies(); viewModel.CategoryList = categoryList; viewModel.Category = categoryList.FirstOrDefault(c => c.Id == categoryId); return(View(viewModel)); }