File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
src/MongoDB.Bson/Serialization Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -418,16 +418,15 @@ internal class FreezeContext
418418 /// <returns>The frozen class map.</returns>
419419 public BsonClassMap Freeze ( ) => Freeze ( BsonSerializer . DefaultDomain ) ;
420420
421-
422421 internal BsonClassMap Freeze ( IBsonSerializationDomain domain )
423422 {
424- var freezeContext = new FreezeContext ( ) { SerializationDomain = domain } ;
423+ var freezeContext = new FreezeContext { SerializationDomain = domain } ;
425424 return Freeze ( freezeContext ) ;
426425 }
427426
428- private BsonClassMap Freeze ( FreezeContext context )
427+ private BsonClassMap Freeze ( FreezeContext context ) //TODO This is not completely correct, because LookupClassMap calls freeze
429428 {
430- var configLock = ( context . SerializationDomain as IBsonSerializationDomainInternal ) ! . ConfigLock ;
429+ var configLock = ( context . SerializationDomain as IBsonSerializationDomainInternal ) ! . ConfigLock ; //TODO This is ugly
431430 configLock . EnterReadLock ( ) ;
432431 try
433432 {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ private static IBsonSerializer<TInterface> CreateInterfaceSerializer(IBsonSerial
4848 var classMap = ( BsonClassMap ) Activator . CreateInstance ( classMapType ) ;
4949 classMap . AutoMap ( ) ;
5050 classMap . SetDiscriminatorConvention ( domain . LookupDiscriminatorConvention ( typeof ( TInterface ) ) ) ;
51- classMap . Freeze ( ) ;
51+ classMap . Freeze ( domain ) ;
5252 return new BsonClassMapSerializer < TInterface > ( classMap ) ;
5353 }
5454 #endregion
You can’t perform that action at this time.
0 commit comments