public ActionResult Compose(Message message) { message.DateCreated = DateTime.Now; db.Messages.Add(message); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Compose(int id) { Message model = new Message { UserId = id, SenderName = User.Identity.Name, isRead = false }; return View(model); }