public ActionResult Create(Message message)
        {
            if (ModelState.IsValid)
            {
               // db.Messages.Add(message);
               // db.SaveChanges();

                message.Sender = unitOfWork.Users.ToList().Where(t => t.UserName == User.Identity.Name).Single();
                message.Receiver = unitOfWork.Users.Find(message.ReceiverId);
                message.Date = DateTime.Now;
                message.ReadMark = false;
                unitOfWork.Messages.Add(message);
                unitOfWork.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.SenderId = new SelectList(unitOfWork.Users.ToList(), "UserName", "UserName", message.SenderId);
            ViewBag.ReceiverId = new SelectList(unitOfWork.Users.ToList(), "UserName", "UserName", message.ReceiverId);
            return View(message);
        }
        public ActionResult Edit(Message message)
        {
            if (ModelState.IsValid)
            {
               // db.Entry(message).State = EntityState.Modified;
               // db.SaveChanges();

                unitOfWork.Messages.Update(message);
                unitOfWork.SaveChanges();
                return RedirectToAction("Index");
            }
            ViewBag.SenderId = new SelectList(unitOfWork.Users.ToList(), "UserName", "Password", message.SenderId);
            ViewBag.ReceiverId = new SelectList(unitOfWork.Users.ToList(), "UserName", "Password", message.ReceiverId);
            return View(message);
        }