WeddingPlatform.Web 1.0.0.0
지도, 갤러리, 방명록, 계좌 안내와 배경음악을 링크 하나에 담는 무료 모바일 청첩장 서비스입니다.
로딩중...
검색중...
일치하는것 없음
WeddingOptions.cs
이 파일의 문서화 페이지로 가기
1using System.IO;
2using Microsoft.Extensions.Configuration;
3
5
14public sealed class WeddingOptions
15{
24 public string DataPath { get; set; } = "";
33 public string SuperAdminPassword { get; set; } = "v1.600000.1oy6GjdnZFCRZpxUY6R4tQ==.1r45CdqBw/2U22r0bF9KwzdIfyCVkkRt/VcoAg19LrQ=";
42 public string AtlanAuthKey { get; set; } = "";
51 public string TmapAppKey { get; set; } = "";
52
61 public string ResolvedDataPath
62 {
63 get
64 {
65 if (string.IsNullOrWhiteSpace(DataPath))
66 {
67 var outputDataPath = Path.Combine(AppContext.BaseDirectory, "App_Data", "Wedding");
68 var sourceDataPath = TryFindSourceDataPath();
69 return sourceDataPath ?? outputDataPath;
70 }
71
72 return Path.IsPathRooted(DataPath)
73 ? DataPath
74 : Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, DataPath));
75 }
76 }
77
102 public static WeddingOptions From(IConfiguration configuration)
103 {
104 var opts = new WeddingOptions();
105 configuration.GetSection("Wedding").Bind(opts);
106 return opts;
107 }
108
125 private static string? TryFindSourceDataPath()
126 {
127 var dir = new DirectoryInfo(AppContext.BaseDirectory);
128 while (dir is not null)
129 {
130 var candidate = Path.Combine(dir.FullName, "App_Data", "Wedding");
131 if (Directory.Exists(candidate) && File.Exists(Path.Combine(dir.FullName, "WeddingPlatform.Web.csproj")))
132 {
133 return candidate;
134 }
135
136 dir = dir.Parent;
137 }
138
139 return null;
140 }
141}
static WeddingOptions From(IConfiguration configuration)