Exemplo n.º 1
0
 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"));
 }
Exemplo n.º 2
0
 public IActionResult AddSuggestions(SuggestionResponse suggestionResponse)
 {
     SuggestionStorage.AddSuggestion(suggestionResponse);
     return(View("SuggestionConfirmation", suggestionResponse)); // pass in the object with the model
 }