public ActionResult Index(int? id) { ContactCardViewModel CC = new ContactCardViewModel(); CC.CC = db.ContactCards.ToList(); return View(CC); }
public ActionResult Create(ContactCardViewModel contactCardViewModel) { ContactCard contactCard = contactCardViewModel.C; if (ModelState.IsValid) { db.ContactCards.Add(contactCard); db.SaveChanges(); return RedirectToAction("Index"); } return View(contactCard); }