示例#1
0
        public ActionResult Compose(Message message)
        {
            message.DateCreated = DateTime.Now;
            db.Messages.Add(message);
            db.SaveChanges();

            return RedirectToAction("Index");
        }
示例#2
0
        public ActionResult Compose(int id)
        {
            Message model = new Message
            {
                UserId = id,
                SenderName = User.Identity.Name,
                isRead = false
            };

            return View(model);
        }