public ActionResult Index() { var db = new PeopleDb(@"Data Source=.\sqlexpress;Initial Catalog=Food;Integrated Security=True"); var ppl = db.GetAll(); return(View(ppl)); }
public IActionResult GetAll() { var db = new PeopleDb(_connectionString); List <Person> ppl = db.GetAll(); return(Json(ppl)); }
public ActionResult Index() { var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString); IEnumerable <Person> ppl = db.GetAll(); return(View(ppl)); }
public ActionResult Index() { PeopleDb db = new PeopleDb(_connectionString); PeopleViewModel vm = new PeopleViewModel { People = db.GetAll() }; return(View(vm)); }
public IActionResult ShowPeople() { PeopleDb db = new PeopleDb(_connectionString); return(View(db.GetAll())); }
public ActionResult Index() { var db = new PeopleDb(ConfigurationManager.ConnectionStrings["MvcApplication2.Properties.Settings.PeopleConStr"].ConnectionString); IEnumerable<Person> ppl = db.GetAll(); return View(ppl); }