示例#1
0
        public ActionResult Index()
        {
            PersonService service = new PersonService();
            var personList = service.GetPeople();

            return View(personList);
        }
示例#2
0
        public ActionResult Create([ModelBinder(typeof(PersonModelBinder))]
            PersonViewModel viewModel)
        {
            if (!ModelState.IsValid) return View();

            PersonService service = new PersonService();
            service.Add(viewModel);

            return RedirectToAction("Index");
        }
示例#3
0
 public ActionResult List(PersonInputModel person)
 {
     var service = new PersonService();
     var people = service.GetPeopleByBirthdate(person.Birthdate);
     return View(people);
 }