public async Task <PageBlockTypeFileDetails> ExecuteAsync(GetPageBlockTypeFileDetailsByFileNameQuery query, IExecutionContext executionContext)
        {
            var viewPath = _viewLocator.GetPathByFileName(query.FileName);

            if (string.IsNullOrEmpty(viewPath))
            {
                throw new FileNotFoundException($"Page block type view file '{query.FileName}' not found.", query.FileName);
            }

            var view = await _viewFileReader.ReadViewFileAsync(viewPath);

            if (view == null)
            {
                throw new FileNotFoundException($"Page block type view file '{query.FileName}' not found at location '{viewPath}'.", viewPath);
            }

            var parsedData           = ParseViewFile(view);
            var pageTemplateFileInfo = new PageBlockTypeFileDetails();

            pageTemplateFileInfo.Name        = StringHelper.FirstNonEmpty(parsedData.Name, TextFormatter.PascalCaseToSentence(query.FileName));
            pageTemplateFileInfo.Description = parsedData.Description;
            pageTemplateFileInfo.Templates   = await MapChildTemplates(query.FileName);

            return(pageTemplateFileInfo);
        }
        private string GetViewPath(IEntityVersionPageBlockRenderDetails blockViewModel)
        {
            string viewPath;
            string fileName = blockViewModel.BlockType.FileName;

            if (blockViewModel.Template == null)
            {
                viewPath = _pageBlockTypeViewFileLocator.GetPathByFileName(fileName);
            }
            else
            {
                viewPath = _pageBlockTypeViewFileLocator.GetTemplatePathByTemplateFileName(fileName, blockViewModel.Template.FileName);
            }

            if (viewPath == null)
            {
                return(null);
            }
            return("~" + viewPath);
        }