Exemple #1
0
        // GET: Home
        public ActionResult Index()
        {
            var database = new FakeContactDatabase();

            var contacts = database.GetAll();

            return(View(contacts));
        }
Exemple #2
0
        //
        // 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));
        }
Exemple #4
0
        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));
        }
Exemple #5
0
        public List <Contact> Get()
        {
            var repo = new FakeContactDatabase();

            return(repo.GetAll());
        }