コード例 #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
ファイル: HomeController.cs プロジェクト: NechamaT/PeopleList
        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()));
        }