Dreamine.Web
1.0.0.0
WPF와 Blazor를 한 코드 흐름으로 연결하고 반복적인 MVVM 코드를 줄이는 오픈소스 FullKit 공식 웹 애플리케이션입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
DocumentationCatalogService.cs
이 파일의 문서화 페이지로 가기
1
using
DreamineWeb.Models
;
2
using
Microsoft.AspNetCore.Hosting;
3
using
System.IO;
4
using
System.Text.Json;
5
6
namespace
DreamineWeb.Services
;
7
16
public
sealed
class
DocumentationCatalogService
17
{
26
private
readonly IWebHostEnvironment
_environment
;
27
36
private
IReadOnlyList<DocumentationProjectInfo>?
_projects
;
37
62
public
DocumentationCatalogService
(IWebHostEnvironment environment)
63
{
64
_environment
= environment ??
throw
new
ArgumentNullException(nameof(environment));
65
}
66
91
public
IReadOnlyList<DocumentationProjectInfo>
GetProjects
()
92
{
93
if
(
_projects
is not
null
)
94
return
_projects
;
95
96
string
catalogPath = Path.Combine(
_environment
.WebRootPath,
"understand"
,
"project-catalog.json"
);
97
if
(!File.Exists(catalogPath))
98
throw
new
FileNotFoundException(
"Project documentation catalog was not generated. Run Publish-UnderstandDashboard.ps1."
, catalogPath);
99
100
using
FileStream stream = File.OpenRead(catalogPath);
101
DocumentationProjectCatalog
catalog = JsonSerializer.Deserialize<
DocumentationProjectCatalog
>(stream,
new
JsonSerializerOptions
102
{
103
PropertyNameCaseInsensitive =
true
104
}) ??
new
DocumentationProjectCatalog
();
105
_projects
= catalog.
Projects
.OrderBy(project => project.Category).ThenBy(project => project.Name).ToArray();
106
return
_projects
;
107
}
108
}
DreamineWeb.Models
Definition
DocMember.cs:1
DreamineWeb.Services
Definition
AdminAuthService.cs:6
DreamineWeb.Models.DocumentationProjectCatalog
Definition
DocumentationProjectInfo.cs:194
DreamineWeb.Models.DocumentationProjectCatalog.Projects
List< DocumentationProjectInfo > Projects
Definition
DocumentationProjectInfo.cs:213
DreamineWeb.Services.DocumentationCatalogService.DocumentationCatalogService
DocumentationCatalogService(IWebHostEnvironment environment)
Definition
DocumentationCatalogService.cs:62
DreamineWeb.Services.DocumentationCatalogService._environment
readonly IWebHostEnvironment _environment
Definition
DocumentationCatalogService.cs:26
DreamineWeb.Services.DocumentationCatalogService.GetProjects
IReadOnlyList< DocumentationProjectInfo > GetProjects()
Definition
DocumentationCatalogService.cs:91
DreamineWeb.Services.DocumentationCatalogService._projects
IReadOnlyList< DocumentationProjectInfo >? _projects
Definition
DocumentationCatalogService.cs:36
Services
DocumentationCatalogService.cs
다음에 의해 생성됨 :
1.17.0