Portfolio.Web 1.0.0.0
.NET, Blazor, WPF와 서비스 운영 경험을 프로젝트·이력·기술 스택 단위로 보여주는 개발자 포트폴리오입니다.
로딩중...
검색중...
일치하는것 없음
JsonResumeStore.cs
이 파일의 문서화 페이지로 가기
1using System.IO;
2using System.Text.Json;
4
6
16{
25 private readonly string _root;
34 private static readonly JsonSerializerOptions _json = new() { WriteIndented = true };
35
53
78 private string Path_(string slug) => Path.Combine(_root, slug, "resume.json");
79
104 public async Task<ResumeInfo> GetAsync(string slug)
105 {
106 var path = Path_(slug);
107 if (!File.Exists(path)) return new ResumeInfo();
108 var json = await File.ReadAllTextAsync(path);
109 return JsonSerializer.Deserialize<ResumeInfo>(json) ?? new ResumeInfo();
110 }
111
144 public async Task SaveAsync(string slug, ResumeInfo resume)
145 {
146 var json = JsonSerializer.Serialize(resume, _json);
147 await File.WriteAllTextAsync(Path_(slug), json);
148 }
149}
async Task SaveAsync(string slug, ResumeInfo resume)
static readonly JsonSerializerOptions _json
async Task< ResumeInfo > GetAsync(string slug)