Exemple #1
0
        public async Task <IActionResult> GetBatch(DateTime?lastBatchDate, DateTime?lastPostCreateDate)
        {
            var posts = await _postService.GetPostsForBatchAsync(lastBatchDate, lastPostCreateDate);

            if (!posts.Any())
            {
                return(NoContent());
            }

            var batchDTO = await _batchService.CreateBatchAsync(posts);

            var modelCollection = PostMapper.ConvertToFullScreenPostPartViewModelCollection(batchDTO);

            return(Ok(modelCollection));
        }