コード例 #1
0
        public async Task <IActionResult> DeleteMealFood(int mealId, int foodId, int sesshinId)
        {
            var isAuthorized = await _authorizationService.AuthorizeAsync(User, new MealFood { MealId = mealId, FoodId = foodId }, UserOperations.Delete);

            if (isAuthorized.Succeeded)
            {
                await _mealService.DeleteMealFoodAsync(mealId, foodId);

                return(RedirectToAction("Details", "Sesshins", new { id = sesshinId, mealId = mealId }));
            }
            else
            {
                return(new ChallengeResult());
            }
        }