public ActionResult CreateMessage(int threadId) { Thread thread; using (var repo = new ThreadsRepository()) { thread = repo.GetById(threadId); } var message = new Message { ThreadId = threadId, Thread = thread }; return View(message); }
public ActionResult ThreadMessages(int id) { var thread = default(Thread); using (var repo = new ThreadsRepository()) { thread = repo.GetById(id); } return View(thread.Messages); }