Skip to content

Commit

Permalink
Merge pull request #20 from fortedigital/feature/serializator
Browse files Browse the repository at this point in the history
Allow own implementation of json serializer
  • Loading branch information
AyronK authored Jul 19, 2023
2 parents 901a82d + 95e9086 commit 32942ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Forte.React.AspNetCore/Forte.React.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Packable>true</Packable>
<VersionPrefix>0.3.0.0</VersionPrefix>
<VersionPrefix>0.3.1.0</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Forte.React.AspNetCore/JsonSerializationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Forte.React.AspNetCore;

internal interface IJsonSerializationService : IJsonService
public interface IJsonSerializationService : IJsonService
{
string Serialize<TValue>(TValue value);
}
Expand Down
7 changes: 7 additions & 0 deletions Forte.React.AspNetCore/React/ReactService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> InvokeRenderTo<T>(Component component, object? props = null, params object[] args)
Expand Down

0 comments on commit 32942ed

Please sign in to comment.