Esempio n. 1
0
 public ViewResult Bar()
 {
     var model = new HomeViewModel() {
         HelloWorld = "Hello Mvc!"
     };
     return View(model);
 }
Esempio n. 2
0
        public ViewResult Index(HomeViewModel model)
        {
            model.SubmittedValue = model.HelloWorld;

            if (ModelState.HasErrors)
                throw new Exception(ModelState.Errors.Aggregate((a, b) => { return a + ", " + b; }));

            return View(model);
        }
Esempio n. 3
0
 public ViewResult Foo(HomeViewModel model)
 {
     return View();
 }
Esempio n. 4
0
 public ViewResult Bar(string HelloMvc, int Id)
 {
     var model = new HomeViewModel();
     model.SubmittedValue = "I Was Submitted!";
     return View(model);
 }