public ActionResult New(MailingListEntry entry) { if(ModelState.IsValid) { //ideally would have injected this object via ninject var repo = new MailingListEntryRepository(); repo.Create(entry); return View("Confirm", entry); } return View(entry); }
public void Create(MailingListEntry data) { context.MailingListEntries.Add(data); context.SaveChanges(); }