Example #1
0
        public async Task <ActionResult <IEnumerable <BoardDto> > > Get()
        {
            var boards = await boardProviderService.GetAllValidBoards();

            List <BoardDto> boardDtos = _mapper.Map <List <BoardDto> >(boards);

            return(boardDtos);
        }
Example #2
0
        public async Task <ActionResult <IEnumerable <BannerDto> > > Get()
        {
            var boards = await boardProviderService.GetAllValidBoards();

            var bannerDtos = new List <BannerDto>();
            var count      = 0;

            foreach (var board in boards)
            {
                foreach (var announcement in board.Announcements.Where(x => x.ShowAsBanner).ToList())
                {
                    bannerDtos.Add(new BannerDto()
                    {
                        ImageUrl = announcement.Img,
                        Title    = announcement.Title,
                        ID       = count++
                    });
                }
            }

            return(bannerDtos);
        }