Esempio n. 1
0
        public async Task <IActionResult> Edit(long id)
        {
            if (!await mealService.ValidateAccessAsync(id, User))
            {
                return(RedirectToAction(nameof(HomeController.Index), "Home"));
            }

            var requestModel = await mealService.CreateMealRequestAsync(id);

            if (requestModel == null)
            {
                return(RedirectToAction(nameof(HomeController.Index), "Home", new { page = 1 }));
            }
            return(View(requestModel));
        }