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