Пример #1
0
        public IActionResult GetPeople()
        {
            var db  = new PeopleDB(_connectionString);
            var ppl = db.GetPeople();

            return(Json(ppl));
        }
Пример #2
0
        public IActionResult Index()
        {
            PeopleDB        db = new PeopleDB(_connectionString);
            PersonViewModel vm = new PersonViewModel
            {
                people = db.GetPeople()
            };

            if (TempData["message"] != null)
            {
                vm.Message = (string)TempData["message"];
            }
            return(View(vm));
        }
 public IActionResult GetPeople()
 {
     return(Json(_database.GetPeople()));
 }