Esempio n. 1
0
        // GET: Home
        public ActionResult Index()
        {
            var database = new FakeContactDatabase();

            var contacts = database.GetAll();

            return(View(contacts));
        }
Esempio n. 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));
        }
Esempio n. 3
0
        // 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));
        }
Esempio n. 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));
        }
Esempio n. 5
0
        public List <Contact> Get()
        {
            var repo = new FakeContactDatabase();

            return(repo.GetAll());
        }