private List <MessageViewModel> getUpdatedListOfMessages() { List <MessageModel> messages = mDB.getAllUserMessages((int)Session["id"]); List <MessageViewModel> updatedList = new List <MessageViewModel>(); foreach (var message in messages) { updatedList.Add(new MessageViewModel(message.ID, message.UserId, mDB.GetMessageTypeById(message.MessageId), message.Date, message.Money)); } return(updatedList); }