// GET: Home public ActionResult Index() { var database = new FakeContactDatabase(); var contacts = database.GetAll(); return(View(contacts)); }
// // GET: /Home/ public ActionResult Index() { var database = new FakeContactDatabase(); // ask the database to get all the contacts var contacts = database.GetAll(); // inject the contact data into the view return(View(contacts)); }
// GET: Home public ActionResult Index() { var database = new FakeContactDatabase(); //get contacts var contacts = database.GetAll(); //inject contact data into the index view return(View(contacts)); }
public ActionResult DeleteContact() { int contactId = int.Parse(Request.Form["ContactId"]); var database = new FakeContactDatabase(); database.Delete(contactId); var contacts = database.GetAll(); return(View("Index", contacts)); }
public List <Contact> Get() { var repo = new FakeContactDatabase(); return(repo.GetAll()); }