예제 #1
0
        // GET: MenuItemController
        public async Task <IActionResult> Index()
        {
            var obj = await _repo.FindAll();

            var objVm = _mapper.Map <List <AdminViewVM> >(obj);

            return(View(objVm));
        }
예제 #2
0
        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);
        }