Пример #1
0
        private async Task WriteConfigObject(IKongvergeConfigObject configObject, string folderPath, string fileName)
        {
            var json = configObject.ToConfigJson();
            var path = Path.Join(folderPath, fileName);

            Log.Verbose($"Writing {path}");
            await _fileProvider.SaveTextContent(path, json);
        }
Пример #2
0
        private static async Task WriteConfigObject(IKongvergeConfigObject configObject, string folderPath, string fileName)
        {
            var json = configObject.ToConfigJson();
            var path = Path.Join(folderPath, fileName);

            Log.Verbose($"Writing {path}");
            using (var stream = File.OpenWrite(path))
                using (var writer = new StreamWriter(stream))
                {
                    await writer.WriteAsync(json);

                    await writer.FlushAsync();
                }
        }