@@ -48,7 +48,6 @@ public class MongoClientSettings : IEquatable<MongoClientSettings>, IInheritable
48
48
private TimeSpan _connectTimeout ;
49
49
private MongoCredential _credential ;
50
50
private bool _directConnection ;
51
- private IBsonSerializationDomain _domain ;
52
51
private TimeSpan _heartbeatInterval ;
53
52
private TimeSpan _heartbeatTimeout ;
54
53
private bool _ipv6 ;
@@ -68,6 +67,7 @@ public class MongoClientSettings : IEquatable<MongoClientSettings>, IInheritable
68
67
private bool _retryReads ;
69
68
private bool _retryWrites ;
70
69
private ConnectionStringScheme _scheme ;
70
+ private IBsonSerializationDomain _serializationDomain ;
71
71
private ServerApi _serverApi ;
72
72
private List < MongoServerAddress > _servers ;
73
73
private ServerMonitoringMode _serverMonitoringMode ;
@@ -101,7 +101,6 @@ public MongoClientSettings()
101
101
_compressors = new CompressorConfiguration [ 0 ] ;
102
102
_connectTimeout = MongoDefaults . ConnectTimeout ;
103
103
_directConnection = false ;
104
- _domain = null ;
105
104
_heartbeatInterval = ServerSettings . DefaultHeartbeatInterval ;
106
105
_heartbeatTimeout = ServerSettings . DefaultHeartbeatTimeout ;
107
106
_ipv6 = false ;
@@ -120,6 +119,7 @@ public MongoClientSettings()
120
119
_retryReads = true ;
121
120
_retryWrites = true ;
122
121
_scheme = ConnectionStringScheme . MongoDB ;
122
+ _serializationDomain = BsonSerializer . DefaultDomain ;
123
123
_serverApi = null ;
124
124
_servers = new List < MongoServerAddress > { new MongoServerAddress ( "localhost" ) } ;
125
125
_serverMonitoringMode = ServerMonitoringMode . Auto ;
@@ -267,23 +267,6 @@ public bool DirectConnection
267
267
}
268
268
}
269
269
270
- /// <summary>
271
- /// //TODO
272
- /// </summary>
273
- /// <exception cref="InvalidOperationException"></exception>
274
- public IBsonSerializationDomain Domain
275
- {
276
- get
277
- {
278
- return _domain ;
279
- }
280
- set
281
- {
282
- if ( _isFrozen ) { throw new InvalidOperationException ( "MongoClientSettings is frozen." ) ; }
283
- _domain = value ;
284
- }
285
- }
286
-
287
270
/// <summary>
288
271
/// Gets a value indicating whether the settings have been frozen to prevent further changes.
289
272
/// </summary>
@@ -491,6 +474,21 @@ public ReadPreference ReadPreference
491
474
}
492
475
}
493
476
477
+ /// <summary>
478
+ /// //TODO
479
+ /// </summary>
480
+ /// <exception cref="InvalidOperationException"></exception>
481
+ /// <exception cref="ArgumentNullException"></exception>
482
+ public IBsonSerializationDomain SerializationDomain
483
+ {
484
+ get => _serializationDomain ;
485
+ set
486
+ {
487
+ if ( _isFrozen ) { throw new InvalidOperationException ( "MongoClientSettings is frozen." ) ; }
488
+ _serializationDomain = value ?? throw new ArgumentNullException ( nameof ( value ) ) ;
489
+ }
490
+ }
491
+
494
492
/// <summary>
495
493
/// Gets or sets the name of the replica set.
496
494
/// </summary>
0 commit comments