コード例 #1
0
        public int GetTotalReferences()
        {
            int          count  = 0;
            List <Label> labels = LabelDao.GetAllElements();

            foreach (Label l in labels)
            {
                count += l.commentsNum;
            }
            return(count);
        }
コード例 #2
0
        public ICollection <LabelDto> GetLabelsDtos()
        {
            ICollection <Label>    labels    = LabelDao.GetAllElements();
            ICollection <LabelDto> labelsDto = new List <LabelDto>();

            foreach (Label l in labels)
            {
                ICollection <CommentDto> commentsDto = new List <CommentDto>();
                foreach (Comment c in l.Comments)
                {
                    commentsDto.Add(new CommentDto(c, c.Event.eventId));
                }
                labelsDto.Add(new LabelDto(l.labelId, l.name, l.commentsNum, commentsDto));
            }
            return(labelsDto);
        }
コード例 #3
0
 public ICollection <Label> GetAllLabels()
 {
     return(LabelDao.GetAllElements());
 }
コード例 #4
0
 public int GetNumberOfLabels()
 {
     return(LabelDao.GetAllElements().Count);
 }