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
405
405
{
406
406
public int FreezeNestingLevel { get ; set ; } = 0 ;
407
407
public Queue < Type > KnownTypesQueue { get ; set ; } = new ( ) ;
408
- public IBsonSerializationDomain SerializationDomain { get ; set ; }
408
+ public IBsonSerializationDomainInternal SerializationDomain { get ; set ; }
409
409
}
410
410
411
411
/// <summary>
412
412
/// Freezes the class map.
413
413
/// </summary>
414
414
/// <returns>The frozen class map.</returns>
415
- public BsonClassMap Freeze ( ) => Freeze ( BsonSerializer . DefaultSerializationDomain ) ;
415
+ public BsonClassMap Freeze ( ) => Freeze ( BsonSerializer . DefaultSerializationDomain as IBsonSerializationDomainInternal ) ;
416
416
417
- internal BsonClassMap Freeze ( IBsonSerializationDomain domain )
417
+ internal BsonClassMap Freeze ( IBsonSerializationDomainInternal domain )
418
418
{
419
419
var freezeContext = new FreezeContext { SerializationDomain = domain } ;
420
420
return Freeze ( freezeContext ) ;
421
421
}
422
422
423
423
private BsonClassMap Freeze ( FreezeContext context ) //TODO This is not completely correct, because LookupClassMap calls freeze
424
424
{
425
- var configLock = ( context . SerializationDomain as IBsonSerializationDomainInternal ) ! . ConfigLock ; //TODO This is ugly
425
+ var configLock = context . SerializationDomain ! . ConfigLock ;
426
426
configLock . EnterReadLock ( ) ;
427
427
try
428
428
{
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ public BsonClassMap LookupClassMap(Type classType)
100
100
classMap = newClassMap ;
101
101
}
102
102
103
- return classMap . Freeze ( ) ;
103
+ return classMap . Freeze ( _serializationDomain ) ;
104
104
}
105
105
finally
106
106
{
You can’t perform that action at this time.
0 commit comments