public ActionResult Index()
        {
            IQueryable<MessageModel> list = eventServices.GetMessages(new GetMessagesModel
            {
                UserProfileID = accountServices.GetUserProfileByUsername(User.Identity.Name).UserProfileId,
                GetUnreadOnly = false
            });

            List<MessageViewModel> returnValue = new List<MessageViewModel>();

            foreach (MessageModel mm in list)
            {
                UserProfileModel sender = accountServices.GetUserProfileByUserProfileId(mm.SenderProfileID);

                MessageViewModel mvm = new MessageViewModel
                {
                    EventID = mm.EventID != null ? (int)mm.EventID : -1,

                    Message = mm.Message,
                    MessageID = mm.MessageID,
                    SenderName = sender.FirstName + " " + sender.LastName,
                    SenderProfileID = mm.SenderProfileID,
                    Read = mm.Read
                };

                if (mvm.Message.Length > MESSAGE_PREVIEW_LENGTH)
                {
                    mvm.Message = mvm.Message.Substring(0, MESSAGE_PREVIEW_LENGTH) + "...";
                }

                EventModel em = eventServices.GetEventById(mm.EventID != null ? (int)mm.EventID : -1);

                if (em != null)
                {
                    mvm.EventName = em.Title;
                }

                returnValue.Add(mvm);

            }

            return View(returnValue.AsQueryable());
        }
        public ActionResult ViewMessage(String id = "00000000-0000-0000-0000-000000000000")
        {
            MessageModel mm = eventServices.GetMessage(new GetMessageModel
            {
                MessageID = new Guid(id)
            });
            UserProfileModel sender = accountServices.GetUserProfileByUserProfileId(mm.SenderProfileID);
            MessageViewModel mvm = new MessageViewModel
            {
                EventID = mm.EventID != null ? (int)mm.EventID : -1,

                Message = mm.Message,
                MessageID = mm.MessageID,
                SenderName = sender.FirstName + " " + sender.LastName,
                SenderProfileID = mm.SenderProfileID
            };

            EventModel em = eventServices.GetEventById(mm.EventID != null ? (int)mm.EventID : -1);

            if (em != null)
            {
                mvm.EventName = em.Title;
            }

            try
            {
                eventServices.MarkAsRead(mm.MessageID, true);
            }
            catch (Exception e)
            {
                //temp
            }

            return View(mvm);
        }