Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit b81c8b08 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

serialize enums in model data

parent c56fb59d
No related branches found
No related tags found
No related merge requests found
......@@ -205,10 +205,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
// TODO: MQ 20200410 - Remove for official release!
if (SerializeVectoRunData) {
File.WriteAllText(
var jsonSerializerSettings = new JsonSerializerSettings();
jsonSerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
File.WriteAllText(
Path.Combine(
(ReportWriter as FileOutputWriter)?.BasePath ?? "", $"{data.JobName}_{data.Cycle.Name}{data.ModFileSuffix}.json"),
JsonConvert.SerializeObject(data, Formatting.Indented));
JsonConvert.SerializeObject(data, Formatting.Indented, jsonSerializerSettings));
}
data.JobNumber = JobNumber;
data.RunNumber = current;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment