Пример #1
0
 public IActionResult Helper(Guitar model)
 {
     if (ModelState.IsValid)
     {
         return View("GuitarSaved", model);
     }
     return View(model);
 }
Пример #2
0
 public IActionResult Helper()
 {
     var model = new Guitar();
     model.Brand = "Gibson";
     model.Model = "Les Paul";
     model.HasWhammyBar = false;
     return View(model);
 }
Пример #3
0
 public IActionResult ControlFlow()
 {
     var model = new Guitar();
     model.Brand = "Charvel";
     model.Model = "Metal Shedder";
     model.WhammyBarType = "Floyd Rose";
     model.Description = "Death to all but metal";
     model.Strings = new List<string> { "E", "A", "D", "G", "B", "E" };
     model.HasWhammyBar = true;
     return View(model);
 }
Пример #4
0
 public IActionResult Variables()
 {
     var model = new Guitar();
     model.Brand = "Gibson";
     model.Model = "Les Paul";
     model.Description = "<blink>Very cool guitar</blink>";
     model.Strings = new List<string> {"E","A","D","G","B","E" };
     model.HasWhammyBar = false;
     return View(model);
 }
Пример #5
0
        public IActionResult ExplicitMarkup()
        {
            var model = new Guitar { Brand="Gibson", Model="Les Paul", Strings= new List<string> { "E","A","D","G","B","E"} };

            return View(model);
        }