示例#1
0
        public ActionResult GetPeople()
        {
            PeopleDb             pdb    = new PeopleDb(Properties.Settings.Default.conStr);
            IEnumerable <Person> people = pdb.GetAllPeople();

            return(Json(people, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult Index()
        {
            PeopleDb             pdb    = new PeopleDb(Properties.Settings.Default.conStr);
            IEnumerable <Person> people = pdb.GetAllPeople();

            return(View(people));
        }
示例#3
0
        public IActionResult Index()
        {
            var db = new PeopleDb(_connectionString);
            var vm = new IndexViewModel
            {
                People = db.GetAllPeople()
            };

            if (TempData["message"] != null)
            {
                vm.Message = (string)TempData["message"];
            }
            return(View(vm));
        }
示例#4
0
        public IActionResult GetAllPeople()
        {
            var db = new PeopleDb(_conStr);

            return(Json(db.GetAllPeople()));
        }