File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ class ShortNameBinder : DefaultSerializationBinder
1212 readonly Dictionary < Type , string > _typeToName = new Dictionary < Type , string > ( ) ;
1313 readonly Dictionary < string , Type > _nameToType = new Dictionary < string , Type > ( ) ;
1414
15- public ShortNameBinder ( List < string > includeShortNameNamespaces )
15+ public ShortNameBinder ( List < Type > includeShortHandForTypes )
1616 {
1717 AddTypesFromNamespace ( typeof ( IdentifiedObject ) . Namespace ) ;
1818 AddTypesFromNamespace ( typeof ( DataSetMember ) . Namespace ) ;
1919
20- foreach ( var includeShortNameNamespace in includeShortNameNamespaces )
20+ foreach ( var type in includeShortHandForTypes )
2121 {
22- AddTypesFromNamespace ( includeShortNameNamespace ) ;
22+ AddType ( type ) ;
2323 }
2424 }
2525
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ public class CsonSerializer
1616 private readonly CustomizedJsonSerializer _serializer ;
1717 private readonly int _lineBufferSize ;
1818
19- public CsonSerializer ( int lineBufferSize = 1024 , List < string > ? includeShorthandNamespaces = null )
19+ public CsonSerializer ( int lineBufferSize = 1024 , List < Type > ? includeShortHandForTypes = null )
2020 {
21- _serializer = new CustomizedJsonSerializer ( includeShorthandNamespaces ?? new List < string > ( ) ) ;
21+ _serializer = new CustomizedJsonSerializer ( includeShortHandForTypes ?? new List < Type > ( ) ) ;
2222 _lineBufferSize = lineBufferSize ;
2323 }
2424
Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ class CustomizedJsonSerializer
1111 {
1212 private JsonSerializerSettings _serializerSettings ;
1313
14- public CustomizedJsonSerializer ( List < string > includeShortNameNamespaces )
14+ public CustomizedJsonSerializer ( List < Type > includeShortHandForTypes )
1515 {
1616 _serializerSettings = new JsonSerializerSettings
1717 {
1818 TypeNameHandling = TypeNameHandling . Objects ,
1919 NullValueHandling = NullValueHandling . Ignore ,
20- SerializationBinder = new ShortNameBinder ( includeShortNameNamespaces ) ,
20+ SerializationBinder = new ShortNameBinder ( includeShortHandForTypes ) ,
2121 Converters =
2222 {
2323 new ObjectReferenceSerializer ( ) ,
You can’t perform that action at this time.
0 commit comments