public ActionResult GetPeople() { PeopleDb pdb = new PeopleDb(Properties.Settings.Default.conStr); IEnumerable <Person> people = pdb.GetAllPeople(); return(Json(people, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { PeopleDb pdb = new PeopleDb(Properties.Settings.Default.conStr); IEnumerable <Person> people = pdb.GetAllPeople(); return(View(people)); }
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)); }
public IActionResult GetAllPeople() { var db = new PeopleDb(_conStr); return(Json(db.GetAllPeople())); }