示例#1
0
        public async Task <IActionResult> Create2(NutritionList nutritionList)
        {
            int success = await _nutritionListService.AddNutritionListAsync(nutritionList);

            if (success < 0)
            {
                return(NotFound());
            }

            return(RedirectToAction("Index2"));
        }
示例#2
0
 public async Task <IActionResult> CreateNutritionList(NutritionList newList)
 {
     try
     {
         int success = await _nutritionListService.AddNutritionListAsync(newList);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
     return(RedirectToAction("GetAllNutritionList"));
 }