Esempio n. 1
0
 /// <summary>
 /// 指定した設定情報を保存します。
 /// </summary>
 /// <param name="value"><see cref="NawakoraBot.Models.Settings"/>。</param>
 public void Save(Settings value) {
     var path = Path.Combine(Environment.GetEnvironmentVariable("WEBROOT_PATH"), FileName);
     var serializer = new JsonSerializer();
     using (var stream = File.Open(path, FileMode.Create, FileAccess.Write))
     using (var writer = new StreamWriter(stream)) {
         serializer.Serialize(writer, value);
     }
 }
 public void SaveTest() {
     var expected = new Settings();
     var target = new SettingsService();
     target.Save(expected);
 }