@@ -58,7 +58,7 @@ public void Dispose()
5858 public class Config
5959 {
6060 private static Config instance ;
61- internal static Config Instance => instance ?? ( instance = new Config ( Defaults ) ) ;
61+ internal static Config Instance => instance ??= new Config ( Defaults ) ;
6262 internal static bool HasInit = false ;
6363
6464 public static Config AssertNotInit ( ) => HasInit
@@ -176,6 +176,7 @@ public bool EmitLowercaseUnderscoreNames
176176 public EmptyCtorFactoryDelegate ModelFactory { get ; set ; }
177177 public string [ ] ExcludePropertyReferences { get ; set ; }
178178 public HashSet < Type > ExcludeTypes { get ; set ; }
179+ public HashSet < string > ExcludeTypeNames { get ; set ; }
179180 public bool EscapeUnicode { get ; set ; }
180181 public bool EscapeHtmlChars { get ; set ; }
181182
@@ -216,7 +217,11 @@ public bool EmitLowercaseUnderscoreNames
216217 MaxDepth = 50 ,
217218 OnDeserializationError = null ,
218219 ModelFactory = ReflectionExtensions . GetConstructorMethodToCache ,
219- ExcludeTypes = new HashSet < Type > { typeof ( System . IO . Stream ) } ,
220+ ExcludeTypes = new HashSet < Type > {
221+ typeof ( System . IO . Stream ) ,
222+ typeof ( System . Reflection . MethodBase ) ,
223+ } ,
224+ ExcludeTypeNames = new HashSet < string > { }
220225 } ;
221226
222227 public Config Populate ( Config config )
@@ -257,6 +262,7 @@ public Config Populate(Config config)
257262 OnDeserializationError = config . OnDeserializationError ;
258263 ModelFactory = config . ModelFactory ;
259264 ExcludeTypes = config . ExcludeTypes ;
265+ ExcludeTypeNames = config . ExcludeTypeNames ;
260266 return this ;
261267 }
262268 }
0 commit comments