Initial commit: JDE Scoping Tool migration project

Set up repository with legacy .NET Framework 4.8 source (OLD/),
new .NET 10 Blazor solution (NEW/), OpenSpec specifications,
documentation, and project configuration.
This commit is contained in:
Joseph Doherty
2026-01-02 07:43:29 -05:00
commit 26ff8d9b4f
1761 changed files with 596509 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
using Newtonsoft.Json;
namespace DataModel.Helpers
{
/// <summary>
/// JSON serialization helpers
/// </summary>
public static class JsonHelpers
{
/// <summary>
/// Converts parameter to JSON
/// </summary>
/// <param name="value">Value to serialize</param>
/// <returns>Parameter value serialized in JSON format</returns>
public static string ToJSON<T>(this T value)
{
return value == null ?
"{}" :
JsonConvert.SerializeObject(value);
}
/// <summary>
/// Parses value from JSON
/// </summary>
/// <param name="json">JSON to parse</param>
/// <returns>Parsed value</returns>
public static T FromJSON<T>(string json)
{
T value = default;
try
{
value = JsonConvert.DeserializeObject<T>(json);
}
catch
{
//Do nothing
}
return value;
}
}
}