public async Task <IViewComponentResult> InvokeAsync()
        {
            // ModelBinder is not supported in view components so we have to bind
            // this manually. We have an issue open to try and improve the experience here
            // https://github.com/cofoundry-cms/cofoundry/issues/125
            var webQuery = new SearchBlogPostsQuery();

            webQuery.PageNumber = IntParser.ParseOrDefault(Request.Query[nameof(webQuery.PageNumber)]);
            webQuery.PageSize   = IntParser.ParseOrDefault(Request.Query[nameof(webQuery.PageSize)]);
            webQuery.CategoryId = IntParser.ParseOrDefault(Request.Query[nameof(webQuery.CategoryId)]);

            var query = new SearchCustomEntityRenderSummariesQuery();

            query.CustomEntityDefinitionCode = BlogPostCustomEntityDefinition.DefinitionCode;
            query.PageNumber    = webQuery.PageNumber;
            query.PageSize      = 30;
            query.PublishStatus = PublishStatusQuery.Published;

            // TODO: Filtering by Category (webQuery.CategoryId)
            // Searching/filtering custom entities is not implemented yet, but it
            // is possible to build your own search index using the message handling
            // framework or writing a custom query against the UnstructuredDataDependency table
            // See issue https://github.com/cofoundry-cms/cofoundry/issues/12

            var entities = await _customEntityRepository.SearchCustomEntityRenderSummariesAsync(query);

            var viewModel = await MapBlogPostsAsync(entities);

            return(View(viewModel));
        }
        /// <summary>
        /// ModelBinder is not supported in view components so we have to bind
        /// this manually. We have an issue open to try and improve the experience here
        /// https://github.com/cofoundry-cms/cofoundry/issues/125
        /// </summary>
        private SearchBlogPostsQuery ModelBind()
        {
            var webQuery = new SearchBlogPostsQuery();

            webQuery.PageNumber = IntParser.ParseOrDefault(Request.Query[nameof(webQuery.PageNumber)]);
            webQuery.PageSize   = IntParser.ParseOrDefault(Request.Query[nameof(webQuery.PageSize)]);
            webQuery.CategoryId = IntParser.ParseOrDefault(Request.Query[nameof(webQuery.CategoryId)]);

            return(webQuery);
        }