Exemple #1
0
        public async Task <bool> HandleAsync(GetMenuItemRequest message, IOutputPort <GetMenuItemResponse> outputPort)
        {
            var response = await _menuItemRepository.GetMenuItem();

            outputPort.Handle(new GetMenuItemResponse(response, true, null));

            return(true);
        }
        // GET: LandingPage
        public ActionResult Index(string pageAlias)
        {
            var menuItemPage = _menuItemRepository.GetMenuItem(pageAlias);

            if (menuItemPage == null)
            {
                return(HttpNotFound());
            }

            HttpContext.Kentico().PageBuilder().Initialize(menuItemPage.DocumentID);

            return(View());
        }
 public IActionResult Get(int id)
 {
     try
     {
         _log4net.Info("Http Get by itemid " + id + " is successfull");
         var item = _menuItemRepository.GetMenuItem(id);
         return(new OkObjectResult(item));
     }
     catch
     {
         _log4net.Error("Error in Get by itemid:" + id);
         return(new NoContentResult());
     }
 }
Exemple #4
0
        public async Task <IActionResult> GetMenuItem(int id)
        {
            var menuItem = await _repo.GetMenuItem(id);

            return(Ok(menuItem));
        }
        // GET: Menu/Details/5
        public ActionResult Details(int id)
        {
            IQueryable <MenuItem> menuItem = _menuitemrepo.GetMenuItem(id);

            return(View(menuItem));
        }
 public MenuItem GetMenuItem(int menuItemId)
 {
     return(_menuItemRepository.GetMenuItem(menuItemId));
 }