// GET: Message public ActionResult ListMessage() { List <message> pvm = new List <message>(); IEnumerable <message> prod = mss.GetAlLMsgBysender((int)Session["LogedUserid"]); foreach (var u in prod) { message G = new message { idMessage = u.idMessage, subject = u.subject, text = u.text, date = u.date, }; pvm.Add(G); } return(View(pvm)); }