Пример #1
0
        public virtual async Task <IActionResult> OnGetAsync()
        {
            ViewModel = _templateDefinitionManager.GetOrNull(Name);
            var filepath = ViewModel.GetVirtualFilePathOrNull();
            var fileInfo = VirtualFileProvider.GetFileInfo(filepath.ToString());

            if (fileInfo == null || fileInfo.IsDirectory)
            {
                return(NotFound());
            }
            Content = await fileInfo.ReadAsStringAsync();

            return(Page());
        }
Пример #2
0
        public TemplateDefinitionDto GetOrNull(string name)
        {
            var entity = _templateDefinitionManager.GetOrNull(name);

            return(ObjectMapper.Map <TemplateDefinition, TemplateDefinitionDto>(entity));
        }