File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/MongoDB.Bson/Serialization Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -405,24 +405,24 @@ internal class FreezeContext
405405 {
406406 public int FreezeNestingLevel { get ; set ; } = 0 ;
407407 public Queue < Type > KnownTypesQueue { get ; set ; } = new ( ) ;
408- public IBsonSerializationDomain SerializationDomain { get ; set ; }
408+ public IBsonSerializationDomainInternal SerializationDomain { get ; set ; }
409409 }
410410
411411 /// <summary>
412412 /// Freezes the class map.
413413 /// </summary>
414414 /// <returns>The frozen class map.</returns>
415- public BsonClassMap Freeze ( ) => Freeze ( BsonSerializer . DefaultSerializationDomain ) ;
415+ public BsonClassMap Freeze ( ) => Freeze ( BsonSerializer . DefaultSerializationDomain as IBsonSerializationDomainInternal ) ;
416416
417- internal BsonClassMap Freeze ( IBsonSerializationDomain domain )
417+ internal BsonClassMap Freeze ( IBsonSerializationDomainInternal domain )
418418 {
419419 var freezeContext = new FreezeContext { SerializationDomain = domain } ;
420420 return Freeze ( freezeContext ) ;
421421 }
422422
423423 private BsonClassMap Freeze ( FreezeContext context ) //TODO This is not completely correct, because LookupClassMap calls freeze
424424 {
425- var configLock = ( context . SerializationDomain as IBsonSerializationDomainInternal ) ! . ConfigLock ; //TODO This is ugly
425+ var configLock = context . SerializationDomain ! . ConfigLock ;
426426 configLock . EnterReadLock ( ) ;
427427 try
428428 {
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ public BsonClassMap LookupClassMap(Type classType)
100100 classMap = newClassMap ;
101101 }
102102
103- return classMap . Freeze ( ) ;
103+ return classMap . Freeze ( _serializationDomain ) ;
104104 }
105105 finally
106106 {
You can’t perform that action at this time.
0 commit comments