public IActionResult Index(WithStorageViewModel model) { // Update the model for an explicitly loaded session model.Content = this.ContentList; if (this.SessionStorage != null) { model.Storage = (Storage)this.SessionStorage; } return(View(model)); }
public IActionResult Submit(WithStorageViewModel model) { this.SessionStorage = model.Storage; if (String.Compare(model.ContentTextBox, "except", true) == 0) { throw new TestException("Malicious Content Exception"); } this.ContentList.Add(model.ContentTextBox); model.ContentTextBox = String.Empty; // never updated without RedirectToAction model.Content = this.ContentList; // persistent object transiently assigned to the model return(View("Index", model)); }
public IActionResult ChangeStorage(WithStorageViewModel model) { this.SessionStorage = model.Storage; model.Content = this.ContentList; return(View("Index", model)); }