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