public async Task <IActionResult> SelectMealPartial(MealPlan plan) { if (plan.RecipeId == 0) { await _planningService.RemovePlan(plan.Id); } else { await _mealsService.UpdateRecipe(plan.RecipeId); if (plan.Id > 0) { await _mealsService.UpdateMealPlan(plan); } else { await _mealsService.AddMealPlan(plan); } } return(RedirectToAction(nameof(Index))); }