// GET: MenuItemController public async Task <IActionResult> Index() { var obj = await _repo.FindAll(); var objVm = _mapper.Map <List <AdminViewVM> >(obj); return(View(objVm)); }
public GetAllMenuItemResponse GetAllMenuItems() { GetAllMenuItemResponse response = new GetAllMenuItemResponse(); IEnumerable <MenuItem> menuItems = _menuItemRepository .FindAll(); if (menuItems != null) { response.MenuItemFound = true; response.MenuItems = menuItems.ConvertToMenuItemViews(); } else { response.MenuItemFound = false; } return(response); }