From 95e9086caa7e81d76de091f948cb8a5679c0d209 Mon Sep 17 00:00:00 2001 From: AyronK Date: Wed, 19 Jul 2023 09:59:30 +0200 Subject: [PATCH] Allow own implementation of json serializer --- Forte.React.AspNetCore/Forte.React.AspNetCore.csproj | 2 +- Forte.React.AspNetCore/JsonSerializationService.cs | 2 +- Forte.React.AspNetCore/React/ReactService.cs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Forte.React.AspNetCore/Forte.React.AspNetCore.csproj b/Forte.React.AspNetCore/Forte.React.AspNetCore.csproj index d80ccb9..4bd5ced 100644 --- a/Forte.React.AspNetCore/Forte.React.AspNetCore.csproj +++ b/Forte.React.AspNetCore/Forte.React.AspNetCore.csproj @@ -6,7 +6,7 @@ enable latest true - 0.3.0.0 + 0.3.1.0 diff --git a/Forte.React.AspNetCore/JsonSerializationService.cs b/Forte.React.AspNetCore/JsonSerializationService.cs index b9efd9a..d3b99c2 100644 --- a/Forte.React.AspNetCore/JsonSerializationService.cs +++ b/Forte.React.AspNetCore/JsonSerializationService.cs @@ -6,7 +6,7 @@ namespace Forte.React.AspNetCore; -internal interface IJsonSerializationService : IJsonService +public interface IJsonSerializationService : IJsonService { string Serialize(TValue value); } diff --git a/Forte.React.AspNetCore/React/ReactService.cs b/Forte.React.AspNetCore/React/ReactService.cs index 7dfa247..f4eeaa9 100644 --- a/Forte.React.AspNetCore/React/ReactService.cs +++ b/Forte.React.AspNetCore/React/ReactService.cs @@ -56,6 +56,13 @@ public ReactService(INodeJSService nodeJsService, ReactConfiguration config) _config = config; _jsonService = new JsonSerializationService(new ReactJsonSerializerOptions().Options); } + + public ReactService(INodeJSService nodeJsService, IJsonSerializationService jsonService, ReactConfiguration config) + { + _nodeJsService = nodeJsService; + _config = config; + _jsonService = jsonService; + } #endif private async Task InvokeRenderTo(Component component, object? props = null, params object[] args)