Skip to content

Commit 07c555a

Browse files
author
Elad Zelingher
committed
Allow specifying JsonSerializer in constructor
1 parent 6c6bd57 commit 07c555a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/WampSharp.Default/Newtonsoft/JsonFormatter.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ namespace WampSharp.Newtonsoft
77
{
88
public class JsonFormatter : IWampFormatter<JToken>
99
{
10-
private readonly JsonSerializer mSerializer = new JsonSerializer();
10+
private readonly JsonSerializer mSerializer;
11+
12+
public JsonFormatter() : this(new JsonSerializer())
13+
{
14+
}
15+
16+
public JsonFormatter(JsonSerializer serializer)
17+
{
18+
mSerializer = serializer;
19+
}
1120

1221
public bool CanConvert(JToken argument, Type type)
1322
{

0 commit comments

Comments
 (0)