Improved Git merge performance of exported files

The exported entries appear now in a deterministic order, which made
merges a lot easier.
This commit is contained in:
Thorsten Sommer 2023-01-22 21:58:01 +01:00
parent 28db843a3a
commit bafb325880
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -160,10 +160,10 @@ public sealed class DataContext : DbContext, IDataContext
await JsonSerializer.SerializeAsync(fileStream,
new JsonData
{
Settings = this.Settings.Select(n => n.ToJsonSetting()).ToList(),
Sections = this.Sections.Select(n => n.ToJsonSection()).ToList(),
TextElements = this.TextElements.Select(n => n.ToJsonTextElement()).ToList(),
Translations = this.Translations.Select(n => n.ToJsonTranslation()).ToList(),
Settings = this.Settings.OrderBy(n => n.UniqueId).Select(n => n.ToJsonSetting()).ToList(),
Sections = this.Sections.OrderBy(n => n.UniqueId).Select(n => n.ToJsonSection()).ToList(),
TextElements = this.TextElements.OrderBy(n => n.UniqueId).Select(n => n.ToJsonTextElement()).ToList(),
Translations = this.Translations.OrderBy(n => n.UniqueId).Select(n => n.ToJsonTranslation()).ToList(),
}, jsonSettings);
}