Exemplo n.º 1
0
        private void SaveAppendedResults(AppendedResults appendedResults)
        {
            if (string.IsNullOrEmpty(Context.JsonPath))
            {
                return;
            }

            _log.Info($"Saving {appendedResults.AppendedVisits.Count} visits data to '{Context.JsonPath}'");

            File.WriteAllText(Context.JsonPath, appendedResults.ToJson().IndentJson());
        }
        private void SaveAppendedResults(string sourcePath, AppendedResults appendedResults)
        {
            if (string.IsNullOrEmpty(Context.JsonPath))
            {
                return;
            }

            var savePath = Directory.Exists(Context.JsonPath)
                ? Path.Combine(Context.JsonPath, $"{Path.GetFileName(sourcePath)}.json")
                : Context.JsonPath;

            Log.Info($"Saving {appendedResults.AppendedVisits.Count} visits data to '{savePath}'");

            File.WriteAllText(savePath, appendedResults.ToJson().IndentJson());
        }