Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
 public IActionResult ChangeStorage(WithStorageViewModel model)
 {
     this.SessionStorage = model.Storage;
     model.Content       = this.ContentList;
     return(View("Index", model));
 }