コード例 #1
0
        public async Task <IActionResult> InsertFoodType(FoodTypeDisplayModel fType)
        {
            if (ModelState.IsValid)
            {
                FoodTypeModel newFoodType = new FoodTypeModel
                {
                    FoodType = fType.FoodType,
                };

                await _data.InsertFoodType(newFoodType);

                return(RedirectToAction("ViewFoodTypes"));
            }
            return(View());
        }
コード例 #2
0
 // Insert Food Type into database
 public async Task InsertFoodType(FoodTypeModel foodType)
 {
     await _sql.SaveData <FoodTypeModel>("FoodType_Insert", foodType);
 }