public void StoreReduction(ReductionRecord record) { var recordInFile = new ReductionRecordInFile { ReducedCompositionHashBase16 = CommonConversion.StringBase16FromByteArray(record.ReducedCompositionHash), ReducedValue = new ValueInFile { LiteralString = record.ReducedValueLiteralString }, }; var fileName = recordInFile.ReducedCompositionHashBase16; var filePath = ImmutableList.Create(fileName); reductionFileStoreWriter.SetFileContent( filePath, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(recordInFile, recordSerializationSettings))); }
public void StoreReduction(ReductionRecord record) { var recordInFile = new ReductionRecordInFile { ReducedCompositionHashBase16 = CommonConversion.StringBase16FromByteArray(record.ReducedCompositionHash), ReducedValue = new ValueInFile { LiteralString = record.ReducedValueLiteralString }, }; var fileName = recordInFile.ReducedCompositionHashBase16; var filePath = Path.Combine(ReductionDirectoryPath, fileName); Directory.CreateDirectory(Path.GetDirectoryName(filePath)); File.WriteAllText(filePath, JsonConvert.SerializeObject(recordInFile, RecordSerializationSettings), Encoding.UTF8); }