public ActionResult MenuItems(string id) { var context = new AppSecurityContext(); var menuRepository = new MenuRepository(context); var menuItemRepository = new MenuItemRepository(context); var menu = menuRepository.Find(id); var items = menuItemRepository.GetItemsByMenuKey(id); var model = new MenuItemListViewModel(); model.MenuItems = mapper.Map <ICollection <MenuItemViewModel> >(items); model.MenuKey = menu.Key; model.MenuName = menu.Name; return(View(model)); }