public ActionResult Create(GuestbookEntry entry) { entry.DateAdded = DateTime.Now; db.Entries.Add(entry); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Create(GuestbookEntry entry) { if (ModelState.IsValid) { _repository.AddEntry(entry); return RedirectToAction("Index"); } return View(entry); }
public void AddEntry(GuestbookEntry entry) { entry.DateAdded = DateTime.Now; _db.Entries.Add(entry); _db.SaveChanges(); }
public void AddEntry(GuestbookEntry entry) { _entries.Add(entry); }