Пример #1
0
        public ActionResult Index()
        {
            var db  = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True");
            var ppl = db.GetAll();

            return(View(ppl));
        }
Пример #2
0
        public IActionResult GetAll()
        {
            var           db  = new PeopleDb(_connectionString);
            List <Person> ppl = db.GetAll();

            return(Json(ppl));
        }
Пример #3
0
        public ActionResult Index()
        {
            var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString);
            IEnumerable <Person> ppl = db.GetAll();

            return(View(ppl));
        }
Пример #4
0
        public ActionResult Index()
        {
            PeopleDb        db = new PeopleDb(_connectionString);
            PeopleViewModel vm = new PeopleViewModel
            {
                People = db.GetAll()
            };

            return(View(vm));
        }
Пример #5
0
        public IActionResult ShowPeople()
        {
            PeopleDb db = new PeopleDb(_connectionString);

            return(View(db.GetAll()));
        }
Пример #6
0
 public ActionResult Index()
 {
     var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString);
     IEnumerable<Person> ppl = db.GetAll();
     return View(ppl);
 }