// GET: Contact
        public ActionResult Index()
        {
            PhoneBookDbEntities4    db       = new PhoneBookDbEntities4();
            List <Contact>          list     = db.Contacts.ToList();
            List <ContactViewModel> viewList = new List <ContactViewModel>();

            foreach (Contact s in list)
            {
                ContactViewModel obj = new ContactViewModel();
                obj.ContactId     = s.ContactId;
                obj.ContactNumber = s.ContactNumber;
                obj.Type          = s.Type;
                obj.PersonId      = s.PersonId;

                viewList.Add(obj);
                obj.SaveChanges();
            }

            return(View(viewList));
        }