private async Task <AuthorDetails> MapAuthor(
            BlogPostDataModel dataModel,
            PublishStatusQuery publishStatusQuery
            )
        {
            if (dataModel.AuthorId < 1)
            {
                return(null);
            }

            var authorQuery = new GetCustomEntityRenderSummaryByIdQuery(dataModel.AuthorId, publishStatusQuery.ToRelatedEntityQueryStatus());
            var dbAuthor    = await _customEntityRepository.GetCustomEntityRenderSummaryByIdAsync(authorQuery);

            var model = dbAuthor?.Model as AuthorDataModel;

            if (model == null)
            {
                return(null);
            }

            var author = new AuthorDetails()
            {
                Name      = dbAuthor.Title,
                Biography = HtmlFormatter.ConvertToBasicHtml(model.Biography)
            };

            if (model.ProfileImageAssetId < 1)
            {
                return(author);
            }

            author.ProfileImage = await _imageAssetRepository.GetImageAssetRenderDetailsByIdAsync(model.ProfileImageAssetId.Value);

            return(author);
        }
        private async Task <AuthorDetails> MapAuthor(
            BlogPostDataModel dataModel,
            PublishStatusQuery publishStatusQuery
            )
        {
            if (dataModel.AuthorId < 1)
            {
                return(null);
            }

            var dbAuthor = await _contentRepository
                           .CustomEntities()
                           .GetById(dataModel.AuthorId)
                           .AsRenderSummary(publishStatusQuery)
                           .ExecuteAsync();

            var model = dbAuthor?.Model as AuthorDataModel;

            if (model == null)
            {
                return(null);
            }

            var author = new AuthorDetails()
            {
                Name      = dbAuthor.Title,
                Biography = HtmlFormatter.ConvertToBasicHtml(model.Biography)
            };

            if (model.ProfileImageAssetId < 1)
            {
                return(author);
            }

            author.ProfileImage = await _contentRepository
                                  .ImageAssets()
                                  .GetById(model.ProfileImageAssetId.Value)
                                  .AsRenderDetails()
                                  .ExecuteAsync();

            return(author);
        }