public async Task <IActionResult> Index(int page = 1)
        {
            var model = new KnownChannelsIndexViewModel
            {
                PageSize   = PAGE_SIZE,
                PageNumber = page,
                Page       = await _channelService.GetAll(new PagedAndSortedResultRequestDto
                {
                    Sorting        = "Title",
                    SkipCount      = (page - 1) * PAGE_SIZE,
                    MaxResultCount = PAGE_SIZE,
                })
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Send(int id)
        {
            var post = await _postApplicationService.GetById(id);

            if (post == null)
            {
                return(RedirectToAction(nameof(Index)));
            }
            var channels = await _channelApplicationService.GetAll(
                new PagedAndSortedResultRequestDto
            {
                MaxResultCount = int.MaxValue
            });

            return(View(new PostsSendViewModel
            {
                Id = id,
                Post = post,
                Channels = channels
            }));
        }