示例#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);
 }