Description
Export and Import methods are duplicated per format (XML vs JSON) in both WPF projects:
Servy/Services/ServiceCommands.cs:
ExportXmlConfig() vs ExportJsonConfig() — ~25 lines each, differ only in serializer
ImportXmlConfig() vs ImportJsonConfig() — ~50 lines each, differ only in deserializer
Servy.Manager/Services/ServiceCommands.cs:
ExportServiceToXmlAsync() vs ExportServiceToJsonAsync() — ~23 lines each
ImportXmlConfigAsync() vs ImportJsonConfigAsync() — ~42 lines each
Estimated redundant lines: ~250
Suggested fix
Create generic ExportConfigAsync(format, serializer) and ImportConfigAsync(format, deserializer) methods. Each XML/JSON variant becomes a one-liner.
Description
Export and Import methods are duplicated per format (XML vs JSON) in both WPF projects:
Servy/Services/ServiceCommands.cs:
ExportXmlConfig()vsExportJsonConfig()— ~25 lines each, differ only in serializerImportXmlConfig()vsImportJsonConfig()— ~50 lines each, differ only in deserializerServy.Manager/Services/ServiceCommands.cs:
ExportServiceToXmlAsync()vsExportServiceToJsonAsync()— ~23 lines eachImportXmlConfigAsync()vsImportJsonConfigAsync()— ~42 lines eachEstimated redundant lines: ~250
Suggested fix
Create generic
ExportConfigAsync(format, serializer)andImportConfigAsync(format, deserializer)methods. Each XML/JSON variant becomes a one-liner.