77 * of patent rights can be found in the PATENTS file in the same directory.
88 */
99
10+ using Newtonsoft . Json ;
1011using System . Collections . Generic ;
1112using System . Collections . ObjectModel ;
1213
@@ -32,6 +33,8 @@ static ReactSiteConfiguration()
3233 /// </summary>
3334 private readonly IList < string > _scriptFiles = new List < string > ( ) ;
3435
36+ private JsonSerializerSettings _jsonSerializerSettings ;
37+
3538 /// <summary>
3639 /// Adds a script to the list of scripts that are executed. This should be called for all
3740 /// React components and their dependencies.
@@ -60,7 +63,7 @@ public IList<string> Scripts
6063 /// </summary>
6164 /// <returns><c>true</c> if support for es6 syntax should be rewritten.</returns>
6265 public bool UseHarmony { get ; set ; }
63-
66+
6467 /// <summary>
6568 /// Specifies whether ES6 (harmony) syntax should be transformed
6669 /// </summary>
@@ -69,5 +72,27 @@ public IReactSiteConfiguration SetUseHarmony(bool useHarmony)
6972 UseHarmony = useHarmony ;
7073 return this ;
7174 }
75+
76+ /// <summary>
77+ /// Gets the configuration for json serializer.
78+ /// </summary>
79+ public JsonSerializerSettings JsonSerializerSettings
80+ {
81+ get { return _jsonSerializerSettings ; }
82+ }
83+
84+ /// <summary>
85+ /// Sets the configuration for json serializer.
86+ /// </summary>
87+ /// <param name="settings">Settings.</param>
88+ /// <remarks>
89+ /// Thic confiquration is used when component initialization script
90+ /// is being generated server-side.
91+ /// </remarks>
92+ public IReactSiteConfiguration SetJsonSerializerSettings ( JsonSerializerSettings settings )
93+ {
94+ _jsonSerializerSettings = settings ;
95+ return this ;
96+ }
7297 }
7398}
0 commit comments