Exemplo n.º 1
0
        public ActionResult LoadMessagesBetweenUsers(string targetUserId)
        {
            if (String.IsNullOrEmpty(targetUserId))
            {
                return(null);
            }
            var currentUserId = HttpContext.GetOwinContext().Authentication.User.Identity.GetUserId();
            var currentUser   = _db.Users.Find(currentUserId);
            ChatMessageRepository repository = new ChatMessageRepository();

            ViewBag.currentUserId = currentUser.Id;
            return(PartialView("MessageLoader", repository.GetAllMessagesBetweenUsers(currentUser.Id, targetUserId)));
        }