Skip to content

Commit 35f461a

Browse files
committed
Fix to interface
1 parent cf05d41 commit 35f461a

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

src/MongoDB.Bson/Serialization/BsonSerializationDomain.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public bool UseNullIdChecker
6666
set { __useNullIdChecker = value; }
6767
}
6868

69+
public bool UseNullIdCheckerEnabled => UseNullIdChecker;
70+
6971
/// <summary>
7072
/// Gets or sets whether to use the ZeroIdChecker on value Id types that don't have an IdGenerator registered.
7173
/// </summary>
@@ -75,13 +77,23 @@ public bool UseZeroIdChecker
7577
set { __useZeroIdChecker = value; }
7678
}
7779

80+
public bool UseZeroIdCheckerEnabled => UseZeroIdChecker;
81+
7882
// internal properties
7983
public ReaderWriterLockSlim ConfigLock
8084
{
8185
get { return __configLock; }
8286
}
8387

88+
public IBsonSerializationConfiguration SerializationConfiguration => this;
89+
8490
// public methods
91+
92+
public IBsonCoreSerializer BuildCoreSerializer()
93+
{
94+
return this;
95+
}
96+
8597
/// <summary>
8698
/// Deserializes an object from a BsonDocument.
8799
/// </summary>

src/MongoDB.Bson/Serialization/IBsonSerializationDomain.cs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,30 @@ void RegisterGenericSerializerDefinition(
8181
/// <summary>
8282
/// Gets or sets whether to use the NullIdChecker on reference Id types that don't have an IdGenerator registered.
8383
/// </summary>
84-
bool UseNullIdChecker { get; set; } //TODO This should become a getter only property and a method
84+
bool UseNullIdChecker { get; set; } //TODO It would be nice if this became a method (SetUseNullIdChecker) and the configuration would have only a getter
8585

8686
/// <summary>
8787
/// Gets or sets whether to use the ZeroIdChecker on value Id types that don't have an IdGenerator registered.
8888
/// </summary>
8989
bool UseZeroIdChecker { get; set; }
9090

91+
/// <summary>
92+
/// //TODO
93+
/// </summary>
94+
/// <returns></returns>
95+
IBsonCoreSerializer BuildCoreSerializer();
9196
}
9297

9398
/// <summary>
9499
/// //TODO
95100
/// </summary>
96101
public interface IBsonCoreSerializer //TODO Don't like the name but have no better idea at the moment
97102
{
103+
/// <summary>
104+
/// //TODO
105+
/// </summary>
106+
IBsonSerializationConfiguration SerializationConfiguration { get; }
107+
98108
/// <summary>
99109
/// Deserializes an object from a BsonDocument.
100110
/// </summary>
@@ -292,17 +302,28 @@ public interface IBsonSerializationConfiguration
292302
/// <param name="type">The Type.</param>
293303
/// <returns>A serializer for the Type.</returns>
294304
IBsonSerializer LookupSerializer(Type type);
305+
306+
/// <summary>
307+
/// Gets the serializer registry.
308+
/// </summary>
309+
IBsonSerializerRegistry SerializerRegistry { get; }
310+
311+
/// <summary>
312+
/// Gets whether to use the NullIdChecker on reference Id types that don't have an IdGenerator registered is enabled.
313+
/// </summary>
314+
bool UseNullIdCheckerEnabled { get; }
315+
316+
/// <summary>
317+
/// Gets whether to use the ZeroIdChecker on value Id types that don't have an IdGenerator registered is enabled.
318+
/// </summary>
319+
bool UseZeroIdCheckerEnabled { get; }
295320
}
296321

297322
/// <summary>
298323
/// //TODO
299324
/// </summary>
300325
public interface IBsonSerializationDomain : IBsonSerializationConfigurator, IBsonSerializationConfiguration, IBsonCoreSerializer
301326
{
302-
/// <summary>
303-
/// Gets the serializer registry.
304-
/// </summary>
305-
IBsonSerializerRegistry SerializerRegistry { get; }
306327
}
307328

308329
internal interface IBsonSerializationDomainInternal : IBsonSerializationDomain

0 commit comments

Comments
 (0)