File tree 2 files changed +4
-5
lines changed
src/MongoDB.Bson/Serialization
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -418,16 +418,15 @@ internal class FreezeContext
418
418
/// <returns>The frozen class map.</returns>
419
419
public BsonClassMap Freeze ( ) => Freeze ( BsonSerializer . DefaultDomain ) ;
420
420
421
-
422
421
internal BsonClassMap Freeze ( IBsonSerializationDomain domain )
423
422
{
424
- var freezeContext = new FreezeContext ( ) { SerializationDomain = domain } ;
423
+ var freezeContext = new FreezeContext { SerializationDomain = domain } ;
425
424
return Freeze ( freezeContext ) ;
426
425
}
427
426
428
- private BsonClassMap Freeze ( FreezeContext context )
427
+ private BsonClassMap Freeze ( FreezeContext context ) //TODO This is not completely correct, because LookupClassMap calls freeze
429
428
{
430
- var configLock = ( context . SerializationDomain as IBsonSerializationDomainInternal ) ! . ConfigLock ;
429
+ var configLock = ( context . SerializationDomain as IBsonSerializationDomainInternal ) ! . ConfigLock ; //TODO This is ugly
431
430
configLock . EnterReadLock ( ) ;
432
431
try
433
432
{
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ private static IBsonSerializer<TInterface> CreateInterfaceSerializer(IBsonSerial
48
48
var classMap = ( BsonClassMap ) Activator . CreateInstance ( classMapType ) ;
49
49
classMap . AutoMap ( ) ;
50
50
classMap . SetDiscriminatorConvention ( domain . LookupDiscriminatorConvention ( typeof ( TInterface ) ) ) ;
51
- classMap . Freeze ( ) ;
51
+ classMap . Freeze ( domain ) ;
52
52
return new BsonClassMapSerializer < TInterface > ( classMap ) ;
53
53
}
54
54
#endregion
You can’t perform that action at this time.
0 commit comments