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()); }
// Insert Food Type into database public async Task InsertFoodType(FoodTypeModel foodType) { await _sql.SaveData <FoodTypeModel>("FoodType_Insert", foodType); }