示例#1
0
 //________________________________________________________________________________________
 public static Contact FromViewModel(this Contact rec, vmContact vm)
 {
     rec.ID        = vm.ID;
     rec.FirstName = vm.FirstName;
     rec.LastName  = vm.LastName;
     rec.IsActive  = vm.IsActive;
     return(rec);
 }
示例#2
0
        // GET: Contact
        public ActionResult Index()
        {
            vmContact contact = new vmContact();

            contact.Contacts = context.Contacts.ToList();

            ViewBag.Page = "Contact";

            return(View(contact));
        }