Refactor Description and ProcessData classes to improve JSON handling; add GetDefaultJsonElement method and streamline GetExtractResult logic
This commit is contained in:
@ -408,7 +408,7 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
return result;
|
||||
}
|
||||
|
||||
private Description GetDefault(IFileRead fileRead, Logistics logistics)
|
||||
private static Description GetDefault(IFileRead fileRead, Logistics logistics)
|
||||
{
|
||||
Description result = new()
|
||||
{
|
||||
@ -516,6 +516,15 @@ public class Description : IDescription, Shared.Properties.IDescription
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static JsonElement GetDefaultJsonElement(IFileRead fileRead, Logistics logistics)
|
||||
{
|
||||
JsonElement result;
|
||||
Description description = GetDefault(fileRead, logistics);
|
||||
string json = JsonSerializer.Serialize(description, DescriptionSourceGenerationContext.Default.Description);
|
||||
result = JsonSerializer.Deserialize<JsonElement>(json);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetDateFormat() => "MM/dd/yyyy hh:mm:ss tt";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user