private GuestBook GetGuestbook() { var messages = this.agent.GetGuestBookMessages(); var guestbook = new GuestBook { GuestBookMessages = messages }; return guestbook; }
public ActionResult Send(GuestBookMessage guestBookMessage) { if (!ModelState.IsValid) { var guestbook = new GuestBook { GuestBookMessages = this.agent.GetGuestBookMessages() }; return this.View("Index", guestbook); } agent.SaveGuestBookMessage(guestBookMessage); return this.RedirectToAction("Index"); }