Skip to content

Commit 7c2beb3

Browse files
committed
Small renaming
1 parent 35f461a commit 7c2beb3

File tree

2 files changed

+100
-101
lines changed

2 files changed

+100
-101
lines changed

src/MongoDB.Bson/Serialization/BsonSerializationDomain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public ReaderWriterLockSlim ConfigLock
8585
get { return __configLock; }
8686
}
8787

88-
public IBsonSerializationConfiguration SerializationConfiguration => this;
88+
public IBsonCoreSerializerConfiguration SerializationConfiguration => this;
8989

9090
// public methods
9191

src/MongoDB.Bson/Serialization/IBsonSerializationDomain.cs

Lines changed: 99 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -6,93 +6,23 @@
66

77
namespace MongoDB.Bson.Serialization
88
{
9-
109
/// <summary>
1110
/// //TODO
1211
/// </summary>
13-
public interface IBsonSerializationConfigurator
12+
public interface IBsonSerializationDomain : IBsonCoreSerializerConfigurator, IBsonCoreSerializerConfiguration, IBsonCoreSerializer
1413
{
15-
/// <summary>
16-
/// Registers the discriminator for a type.
17-
/// </summary>
18-
/// <param name="type">The type.</param>
19-
/// <param name="discriminator">The discriminator.</param>
20-
void RegisterDiscriminator(Type type, BsonValue discriminator);
21-
22-
/// <summary>
23-
/// Registers the discriminator convention for a type.
24-
/// </summary>
25-
/// <param name="type">Type type.</param>
26-
/// <param name="convention">The discriminator convention.</param>
27-
void RegisterDiscriminatorConvention(Type type, IDiscriminatorConvention convention);
28-
29-
/// <summary>
30-
/// Registers a generic serializer definition for a generic type.
31-
/// </summary>
32-
/// <param name="genericTypeDefinition">The generic type.</param>
33-
/// <param name="genericSerializerDefinition">The generic serializer definition.</param>
34-
void RegisterGenericSerializerDefinition(
35-
Type genericTypeDefinition,
36-
Type genericSerializerDefinition);
37-
38-
/// <summary>
39-
/// Registers an IdGenerator for an Id Type.
40-
/// </summary>
41-
/// <param name="type">The Id Type.</param>
42-
/// <param name="idGenerator">The IdGenerator for the Id Type.</param>
43-
void RegisterIdGenerator(Type type, IIdGenerator idGenerator);
44-
45-
/// <summary>
46-
/// Registers a serialization provider.
47-
/// </summary>
48-
/// <param name="provider">The serialization provider.</param>
49-
void RegisterSerializationProvider(IBsonSerializationProvider provider);
50-
51-
/// <summary>
52-
/// Registers a serializer for a type.
53-
/// </summary>
54-
/// <typeparam name="T">The type.</typeparam>
55-
/// <param name="serializer">The serializer.</param>
56-
void RegisterSerializer<T>(IBsonSerializer<T> serializer);
57-
58-
/// <summary>
59-
/// Registers a serializer for a type.
60-
/// </summary>
61-
/// <param name="type">The type.</param>
62-
/// <param name="serializer">The serializer.</param>
63-
void RegisterSerializer(Type type, IBsonSerializer serializer);
64-
65-
/// <summary>
66-
/// Tries to register a serializer for a type.
67-
/// </summary>
68-
/// <param name="serializer">The serializer.</param>
69-
/// <param name="type">The type.</param>
70-
/// <returns>True if the serializer was registered on this call, false if the same serializer was already registered on a previous call, throws an exception if a different serializer was already registered.</returns>
71-
bool TryRegisterSerializer(Type type, IBsonSerializer serializer);
14+
}
7215

73-
/// <summary>
74-
/// Tries to register a serializer for a type.
75-
/// </summary>
76-
/// <typeparam name="T">The type.</typeparam>
77-
/// <param name="serializer">The serializer.</param>
78-
/// <returns>True if the serializer was registered on this call, false if the same serializer was already registered on a previous call, throws an exception if a different serializer was already registered.</returns>
79-
bool TryRegisterSerializer<T>(IBsonSerializer<T> serializer);
16+
internal interface IBsonSerializationDomainInternal : IBsonSerializationDomain
17+
{
18+
ReaderWriterLockSlim ConfigLock { get; }
8019

81-
/// <summary>
82-
/// Gets or sets whether to use the NullIdChecker on reference Id types that don't have an IdGenerator registered.
83-
/// </summary>
84-
bool UseNullIdChecker { get; set; } //TODO It would be nice if this became a method (SetUseNullIdChecker) and the configuration would have only a getter
20+
void EnsureKnownTypesAreRegistered(Type nominalType);
8521

86-
/// <summary>
87-
/// Gets or sets whether to use the ZeroIdChecker on value Id types that don't have an IdGenerator registered.
88-
/// </summary>
89-
bool UseZeroIdChecker { get; set; }
22+
IDiscriminatorConvention GetOrRegisterDiscriminatorConvention(Type type,
23+
IDiscriminatorConvention discriminatorConvention);
9024

91-
/// <summary>
92-
/// //TODO
93-
/// </summary>
94-
/// <returns></returns>
95-
IBsonCoreSerializer BuildCoreSerializer();
25+
bool IsDiscriminatorConventionRegisteredAtThisLevel(Type type);
9626
}
9727

9828
/// <summary>
@@ -103,7 +33,7 @@ public interface IBsonCoreSerializer //TODO Don't like the name but have no bett
10333
/// <summary>
10434
/// //TODO
10535
/// </summary>
106-
IBsonSerializationConfiguration SerializationConfiguration { get; }
36+
IBsonCoreSerializerConfiguration SerializationConfiguration { get; }
10737

10838
/// <summary>
10939
/// Deserializes an object from a BsonDocument.
@@ -258,7 +188,95 @@ void Serialize(
258188
/// <summary>
259189
/// //TODO
260190
/// </summary>
261-
public interface IBsonSerializationConfiguration
191+
public interface IBsonCoreSerializerConfigurator
192+
{
193+
/// <summary>
194+
/// Registers the discriminator for a type.
195+
/// </summary>
196+
/// <param name="type">The type.</param>
197+
/// <param name="discriminator">The discriminator.</param>
198+
void RegisterDiscriminator(Type type, BsonValue discriminator);
199+
200+
/// <summary>
201+
/// Registers the discriminator convention for a type.
202+
/// </summary>
203+
/// <param name="type">Type type.</param>
204+
/// <param name="convention">The discriminator convention.</param>
205+
void RegisterDiscriminatorConvention(Type type, IDiscriminatorConvention convention);
206+
207+
/// <summary>
208+
/// Registers a generic serializer definition for a generic type.
209+
/// </summary>
210+
/// <param name="genericTypeDefinition">The generic type.</param>
211+
/// <param name="genericSerializerDefinition">The generic serializer definition.</param>
212+
void RegisterGenericSerializerDefinition(
213+
Type genericTypeDefinition,
214+
Type genericSerializerDefinition);
215+
216+
/// <summary>
217+
/// Registers an IdGenerator for an Id Type.
218+
/// </summary>
219+
/// <param name="type">The Id Type.</param>
220+
/// <param name="idGenerator">The IdGenerator for the Id Type.</param>
221+
void RegisterIdGenerator(Type type, IIdGenerator idGenerator);
222+
223+
/// <summary>
224+
/// Registers a serialization provider.
225+
/// </summary>
226+
/// <param name="provider">The serialization provider.</param>
227+
void RegisterSerializationProvider(IBsonSerializationProvider provider);
228+
229+
/// <summary>
230+
/// Registers a serializer for a type.
231+
/// </summary>
232+
/// <typeparam name="T">The type.</typeparam>
233+
/// <param name="serializer">The serializer.</param>
234+
void RegisterSerializer<T>(IBsonSerializer<T> serializer);
235+
236+
/// <summary>
237+
/// Registers a serializer for a type.
238+
/// </summary>
239+
/// <param name="type">The type.</param>
240+
/// <param name="serializer">The serializer.</param>
241+
void RegisterSerializer(Type type, IBsonSerializer serializer);
242+
243+
/// <summary>
244+
/// Tries to register a serializer for a type.
245+
/// </summary>
246+
/// <param name="serializer">The serializer.</param>
247+
/// <param name="type">The type.</param>
248+
/// <returns>True if the serializer was registered on this call, false if the same serializer was already registered on a previous call, throws an exception if a different serializer was already registered.</returns>
249+
bool TryRegisterSerializer(Type type, IBsonSerializer serializer);
250+
251+
/// <summary>
252+
/// Tries to register a serializer for a type.
253+
/// </summary>
254+
/// <typeparam name="T">The type.</typeparam>
255+
/// <param name="serializer">The serializer.</param>
256+
/// <returns>True if the serializer was registered on this call, false if the same serializer was already registered on a previous call, throws an exception if a different serializer was already registered.</returns>
257+
bool TryRegisterSerializer<T>(IBsonSerializer<T> serializer);
258+
259+
/// <summary>
260+
/// Gets or sets whether to use the NullIdChecker on reference Id types that don't have an IdGenerator registered.
261+
/// </summary>
262+
bool UseNullIdChecker { get; set; } //TODO It would be nice if this became a method (SetUseNullIdChecker) and the configuration would have only a getter
263+
264+
/// <summary>
265+
/// Gets or sets whether to use the ZeroIdChecker on value Id types that don't have an IdGenerator registered.
266+
/// </summary>
267+
bool UseZeroIdChecker { get; set; }
268+
269+
/// <summary>
270+
/// //TODO
271+
/// </summary>
272+
/// <returns></returns>
273+
IBsonCoreSerializer BuildCoreSerializer();
274+
}
275+
276+
/// <summary>
277+
/// //TODO
278+
/// </summary>
279+
public interface IBsonCoreSerializerConfiguration
262280
{
263281
/// <summary>
264282
/// Returns whether the given type has any discriminators registered for any of its subclasses.
@@ -318,23 +336,4 @@ public interface IBsonSerializationConfiguration
318336
/// </summary>
319337
bool UseZeroIdCheckerEnabled { get; }
320338
}
321-
322-
/// <summary>
323-
/// //TODO
324-
/// </summary>
325-
public interface IBsonSerializationDomain : IBsonSerializationConfigurator, IBsonSerializationConfiguration, IBsonCoreSerializer
326-
{
327-
}
328-
329-
internal interface IBsonSerializationDomainInternal : IBsonSerializationDomain
330-
{
331-
ReaderWriterLockSlim ConfigLock { get; }
332-
333-
void EnsureKnownTypesAreRegistered(Type nominalType);
334-
335-
IDiscriminatorConvention GetOrRegisterDiscriminatorConvention(Type type,
336-
IDiscriminatorConvention discriminatorConvention);
337-
338-
bool IsDiscriminatorConventionRegisteredAtThisLevel(Type type);
339-
}
340339
}

0 commit comments

Comments
 (0)