Beispiel #1
0
        public IEnumerable <Message> GetMessagesFromChannel(int channelID)
        {
            Channel        channel  = _channelDao.GetChannelById(channelID);
            List <Message> messages = new List <Message>();

            foreach (var id in channel.Messages)
            {
                messages.Add(_messageDao.GetById(id));
            }
            return(messages);
        }
Beispiel #2
0
        public Message GetByID(int id)
        {
            var message = _messageDao.GetById(id);

            if (message != null)
            {
                message.CommentsCount = _commentDao.GetCommentsCount(new List <ProjectEntity> {
                    message
                }).FirstOrDefault();
            }

            return(message);
        }
        public Message GetByID(int id, bool checkSecurity)
        {
            var message = messageDao.GetById(id);

            if (message != null)
            {
                message.CommentsCount = commentDao.Count(new List <ProjectEntity> {
                    message
                }).FirstOrDefault();
            }

            if (!checkSecurity)
            {
                return(message);
            }

            return(CanRead(message) ? message : null);
        }
 public Message GetById(int messageID)
 {
     return(_messageDao.GetById(messageID));
 }