Replace JSON.NET with System.Text.json (#840)

This commit is contained in:
RobertBeekman authored and GitHub committed 2024-02-28 19:31:38 +01:00
1 parent e112ca9da8
commit a340f8822e
63 files changed
+466 -584

No files matched your search

+2 -3
View File
@@ -4,7 +4,6 @@ using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Artemis.Storage.Entities.Profile.Nodes;
using Newtonsoft.Json;
using SkiaSharp;
namespace Artemis.Core.Services;
@@ -42,12 +41,12 @@ internal class NodeService : INodeService
public string ExportScript(NodeScript nodeScript)
{
nodeScript.Save();
return JsonConvert.SerializeObject(nodeScript.Entity, IProfileService.ExportSettings);
return CoreJson.Serialize(nodeScript.Entity);
}
public void ImportScript(string json, NodeScript target)
{
NodeScriptEntity? entity = JsonConvert.DeserializeObject<NodeScriptEntity>(json);
NodeScriptEntity? entity = CoreJson.Deserialize<NodeScriptEntity>(json);
if (entity == null)
throw new ArtemisCoreException("Failed to load node script");