public Boolean SendPublicMessage(String messageText, int pollID)
        {
            var poll = pollRepository.GetPollByID(pollID);
            var participants = poll.participants.Where(m => m.linkedUser != null);
            var users = from p in participants select p.linkedUser;
            var message = new Message(messageText, users.ToList<User>());
            poll.messages.Add(message);

            pollRepository.UpdatePoll(poll);
            return true;
        }
 public void UpdateMessage(Message message)
 {
     session.SaveOrUpdate(message);
 }
        public Boolean SendPrivateMessage(String messageText, String username, int pollID)
        {
            var poll = pollRepository.GetPollByID(pollID);
            var user = userRepository.GetUserByUsername(username);
            var message = new Message(messageText, user);
            poll.messages.Add(message);

            pollRepository.UpdatePoll(poll);
            return true;
        }