// GET: ReadController Messages page public ActionResult Messages(string id) { try { if (id == null) { return(NotFound()); } var messages = MessageBL.GetMessages(_userManager.GetUserId(User), id); if (messages == null) { return(NotFound()); } return(View(messages)); } catch (Exception e) { TempData["sErrMsg"] = e.Message; return(View()); //return Redirect("~/"); } }
public ActionResult Messages(string id) { _message.To = id; var messageBL = new MessageBL(_uow.messageRepository); var messages = messageBL.GetMessages(CurrentUser().Id, id); var viewModel = new ChatViewModel { Messages = messages, CurrentUser = CurrentUser(), ToUser = ToUser(id) }; return(View(viewModel)); }