This pull request ensures that the existing .refitter file is not overwritten when the user runs the refitter command. It also updates the serialization method to use System.Text.Json.JsonSerializer instead of JsonConvert.SerializeObject.
PR Summary
The pull request modifies the RefitterCodeGenerator.cs file to improve the handling of RefitGeneratorSettings and updates the serialization method.
RefitterCodeGenerator.cs: Updated using directives, added logic to check for a .refitter file before deserializing settings, and moved the serialization of settings to an else block.
RefitterCodeGenerator.cs: Switched from JsonConvert.SerializeObject to a new Serialize method for creating the DependencyContext.
RefitterCodeGenerator.cs: Added a new private Serialize method for serializing RefitGeneratorSettings with System.Text.Json.JsonSerializer.
PR Classification
This pull request ensures that the existing .refitter file is not overwritten when the user runs the refitter command. It also updates the serialization method to use
System.Text.Json.JsonSerializer
instead ofJsonConvert.SerializeObject
.PR Summary
The pull request modifies the
RefitterCodeGenerator.cs
file to improve the handling ofRefitGeneratorSettings
and updates the serialization method.RefitterCodeGenerator.cs
: Updatedusing
directives, added logic to check for a.refitter
file before deserializing settings, and moved the serialization of settings to an else block.RefitterCodeGenerator.cs
: Switched fromJsonConvert.SerializeObject
to a newSerialize
method for creating theDependencyContext
.RefitterCodeGenerator.cs
: Added a new privateSerialize
method for serializingRefitGeneratorSettings
withSystem.Text.Json.JsonSerializer
.