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