public static void Add(Email email) { ISession session = MvcApplication.SessionFactory.OpenSession(); using (ITransaction tx = session.BeginTransaction()) { session.Save(email); tx.Commit(); } }
public ActionResult Index(FormCollection collection) { try { KosherWine.Models.Email email = new KosherWine.Models.Email(); email.Address = Request.Form["Email"]; KosherWine.Models.Email.Add(email); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Index(FormCollection collection) { try { KosherWine.Models.Email email = new KosherWine.Models.Email(); email.Address = Request.Form["Email"]; KosherWine.Models.Email.Add(email); return(RedirectToAction("Index")); } catch { return(View()); } }