コード例 #1
0
ファイル: HomeController.cs プロジェクト: 4padenj/ProvoFood
 public IActionResult Suggestion(SuggestionStorage newSuggestion)
 {
     // Checks for null in the optional FavDish Field on the incoming object
     if (newSuggestion.FavDish == null)
     {
         newSuggestion.FavDish = "It's all tasty!";
     }
     SuggestionStorage.AddSuggestion(newSuggestion);
     return(RedirectToAction("UserSuggestions"));
 }
コード例 #2
0
 public IActionResult AddSuggestions(SuggestionResponse suggestionResponse)
 {
     SuggestionStorage.AddSuggestion(suggestionResponse);
     return(View("SuggestionConfirmation", suggestionResponse)); // pass in the object with the model
 }