Skip to content

Commit e9511c0

Browse files
committed
Big serializer check
1 parent 7311b35 commit e9511c0

15 files changed

+45
-28
lines changed

src/MongoDB.Bson/Serialization/Serializers/DictionaryInterfaceImplementerSerializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ public sealed class DictionaryInterfaceImplementerSerializer<TDictionary> :
3131
IDictionaryRepresentationConfigurable
3232
where TDictionary : class, IDictionary, new()
3333
{
34+
//DOMAIN-API This version should be removed in the future.
3435
/// <summary>
3536
/// Initializes a new instance of the <see cref="DictionaryInterfaceImplementerSerializer{TDictionary}"/> class.
3637
/// </summary>
3738
public DictionaryInterfaceImplementerSerializer()
3839
{
3940
}
4041

42+
//DOMAIN-API This version should be removed in the future.
4143
/// <summary>
4244
/// Initializes a new instance of the <see cref="DictionaryInterfaceImplementerSerializer{TDictionary}"/> class.
4345
/// </summary>

src/MongoDB.Bson/Serialization/Serializers/DictionarySerializerBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private static class Flags
4545
private readonly IBsonSerializer _valueSerializer;
4646

4747
// constructors
48+
//DOMAIN-API This version should be removed in the future.
4849
/// <summary>
4950
/// Initializes a new instance of the <see cref="DictionarySerializerBase{TDictionary}"/> class.
5051
/// </summary>
@@ -53,12 +54,13 @@ public DictionarySerializerBase()
5354
{
5455
}
5556

57+
//DOMAIN-API This version should be removed in the future.
5658
/// <summary>
5759
/// Initializes a new instance of the <see cref="DictionarySerializerBase{TDictionary}"/> class.
5860
/// </summary>
5961
/// <param name="dictionaryRepresentation">The dictionary representation.</param>
6062
public DictionarySerializerBase(DictionaryRepresentation dictionaryRepresentation)
61-
: this(dictionaryRepresentation, BsonSerializer.LookupSerializer<object>(), BsonSerializer.LookupSerializer<object>()) //TODO We can keep this as is?
63+
: this(dictionaryRepresentation, BsonSerializer.LookupSerializer<object>(), BsonSerializer.LookupSerializer<object>())
6264
{
6365
}
6466

@@ -373,6 +375,7 @@ private static class Flags
373375
private readonly Lazy<IBsonSerializer<TValue>> _lazyValueSerializer;
374376

375377
// constructors
378+
//DOMAIN-API This version should be removed in the future.
376379
/// <summary>
377380
/// Initializes a new instance of the <see cref="DictionarySerializerBase{TDictionary, TKey, TValue}"/> class.
378381
/// </summary>
@@ -381,12 +384,14 @@ public DictionarySerializerBase()
381384
{
382385
}
383386

387+
//DOMAIN-API This version should be removed in the future.
388+
//FP Fortunately it seems that all the constructors that should not be used are actually not used in the codebase.
384389
/// <summary>
385390
/// Initializes a new instance of the <see cref="DictionarySerializerBase{TDictionary, TKey, TValue}" /> class.
386391
/// </summary>
387392
/// <param name="dictionaryRepresentation">The dictionary representation.</param>
388393
public DictionarySerializerBase(DictionaryRepresentation dictionaryRepresentation)
389-
: this(dictionaryRepresentation, BsonSerializer.SerializerRegistry) //TODO We can keep this as is?
394+
: this(dictionaryRepresentation, BsonSerializer.SerializerRegistry)
390395
{
391396
}
392397

src/MongoDB.Bson/Serialization/Serializers/EnumerableSerializerBase.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ public abstract class EnumerableSerializerBase<TValue> : SerializerBase<TValue>,
3131
private readonly Lazy<IBsonSerializer> _lazyItemSerializer;
3232

3333
// constructors
34+
//DOMAIN-API This version should be removed in the future.
3435
/// <summary>
3536
/// Initializes a new instance of the <see cref="EnumerableSerializerBase{TValue}"/> class.
3637
/// </summary>
3738
protected EnumerableSerializerBase()
38-
: this(BsonSerializer.SerializerRegistry) //TODO We can keep this as is
39+
: this(BsonSerializer.SerializerRegistry)
3940
{
4041
}
4142

@@ -230,11 +231,12 @@ public abstract class EnumerableSerializerBase<TValue, TItem> : SerializerBase<T
230231
private readonly Lazy<IBsonSerializer<TItem>> _lazyItemSerializer;
231232

232233
// constructors
234+
//DOMAIN-API This version should be removed in the future.
233235
/// <summary>
234236
/// Initializes a new instance of the <see cref="EnumerableSerializerBase{TValue, TItem}"/> class.
235237
/// </summary>
236238
protected EnumerableSerializerBase()
237-
: this(BsonSerializer.SerializerRegistry) //TODO We can keep this as is
239+
: this(BsonSerializer.SerializerRegistry)
238240
{
239241
}
240242

src/MongoDB.Bson/Serialization/Serializers/ExpandoObjectSerializer.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public sealed class ExpandoObjectSerializer : DynamicDocumentBaseSerializer<Expa
3131
// private fields
3232
private readonly IBsonSerializer<List<object>> _listSerializer;
3333

34+
//DOMAIN-API This version should be removed in the future.
3435
/// <summary>
3536
/// Initializes a new instance of the <see cref="ExpandoObjectSerializer"/> class.
3637
/// </summary>
@@ -39,10 +40,6 @@ public ExpandoObjectSerializer()
3940
{
4041
}
4142

42-
/// <summary>
43-
/// //TODO
44-
/// </summary>
45-
/// <param name="serializerRegistry"></param>
4643
internal ExpandoObjectSerializer(IBsonSerializerRegistry serializerRegistry)
4744
{
4845
_listSerializer = serializerRegistry.GetSerializer<List<object>>();

src/MongoDB.Bson/Serialization/Serializers/IEnumerableDeserializingAsCollectionSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ private static void EnsureTIEnumerableIsAnInterface()
4545
// private fields
4646
private readonly Lazy<IBsonSerializer<TItem>> _lazyItemSerializer;
4747

48+
//DOMAIN-API This should be removed in the future.
4849
// constructors
4950
/// <summary>
5051
/// Initializes a new instance of the IEnumerableDeserializingAsCollectionSerializer class.
5152
/// </summary>
5253
public IEnumerableDeserializingAsCollectionSerializer()
53-
: this(BsonSerializer.SerializerRegistry) //TODO We can keep this as is
54+
: this(BsonSerializer.SerializerRegistry)
5455
{
5556
}
5657

src/MongoDB.Bson/Serialization/Serializers/ImpliedImplementationInterfaceSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ public sealed class ImpliedImplementationInterfaceSerializer<TInterface, TImplem
4848
private readonly Lazy<IBsonSerializer<TImplementation>> _lazyImplementationSerializer;
4949

5050
// constructors
51+
//DOMAIN-API This should be removed in the future.
5152
/// <summary>
5253
/// Initializes a new instance of the <see cref="ImpliedImplementationInterfaceSerializer{TInterface, TImplementation}"/> class.
5354
/// </summary>
5455
public ImpliedImplementationInterfaceSerializer()
55-
: this(BsonSerializer.SerializerRegistry) //TODO We can keep this as is
56+
: this(BsonSerializer.SerializerRegistry)
5657
{
5758
}
5859

src/MongoDB.Bson/Serialization/Serializers/KeyValuePairSerializer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ private static class Flags
5353
private readonly Lazy<IBsonSerializer<TValue>> _lazyValueSerializer;
5454

5555
// constructors
56+
//DOMAIN-API This should be removed in the future.
5657
/// <summary>
5758
/// Initializes a new instance of the <see cref="KeyValuePairSerializer{TKey, TValue}"/> class.
5859
/// </summary>
@@ -61,12 +62,13 @@ public KeyValuePairSerializer()
6162
{
6263
}
6364

65+
//DOMAIN-API This should be removed in the future.
6466
/// <summary>
6567
/// Initializes a new instance of the <see cref="KeyValuePairSerializer{TKey, TValue}"/> class.
6668
/// </summary>
6769
/// <param name="representation">The representation.</param>
6870
public KeyValuePairSerializer(BsonType representation)
69-
: this(representation, BsonSerializer.SerializerRegistry) //TODO We can keep this as is?
71+
: this(representation, BsonSerializer.SerializerRegistry)
7072
{
7173
}
7274

src/MongoDB.Bson/Serialization/Serializers/NullableSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ public sealed class NullableSerializer<T> :
6060
private Lazy<IBsonSerializer<T>> _lazySerializer;
6161

6262
// constructors
63+
//DOMAIN-API This should be removed in the future.
6364
/// <summary>
6465
/// Initializes a new instance of the <see cref="NullableSerializer{T}"/> class.
6566
/// </summary>
6667
public NullableSerializer()
67-
: this(BsonSerializer.SerializerRegistry) //TODO We can keep this as is
68+
: this(BsonSerializer.SerializerRegistry)
6869
{
6970
}
7071

src/MongoDB.Bson/Serialization/Serializers/ObjectSerializer.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public sealed class ObjectSerializer : ClassSerializerBase<object>, IHasDiscrimi
4747
/// <summary>
4848
/// Gets the standard instance.
4949
/// </summary>
50-
public static ObjectSerializer Instance => __instance;
50+
public static ObjectSerializer Instance => __instance; //FP This is problematic, but can't do much about it now.
5151

5252
/// <summary>
5353
/// An allowed types function that returns false for all types.
@@ -63,11 +63,12 @@ public sealed class ObjectSerializer : ClassSerializerBase<object>, IHasDiscrimi
6363
private readonly GuidSerializer _guidSerializer;
6464

6565
// constructors
66+
//DOMAIN-API This should be removed in the future.
6667
/// <summary>
6768
/// Initializes a new instance of the <see cref="ObjectSerializer"/> class.
6869
/// </summary>
6970
public ObjectSerializer()
70-
: this(BsonSerializer.LookupDiscriminatorConvention(typeof(object))) //TODO We can keep this as is
71+
: this(BsonSerializer.LookupDiscriminatorConvention(typeof(object)))
7172
{
7273
}
7374

@@ -91,12 +92,13 @@ public ObjectSerializer(IDiscriminatorConvention discriminatorConvention, GuidRe
9192
{
9293
}
9394

95+
//DOMAIN-API This should be removed in the future.
9496
/// <summary>
9597
/// Initializes a new instance of the <see cref="ObjectSerializer"/> class.
9698
/// </summary>
9799
/// <param name="allowedTypes">A delegate that determines what types are allowed.</param>
98100
public ObjectSerializer(Func<Type, bool> allowedTypes)
99-
: this(BsonSerializer.LookupDiscriminatorConvention(typeof(object)), allowedTypes) //TODO We can keep this as is
101+
: this(BsonSerializer.LookupDiscriminatorConvention(typeof(object)), allowedTypes)
100102
{
101103
}
102104

src/MongoDB.Bson/Serialization/Serializers/SerializeAsNominalTypeSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ public sealed class SerializeAsNominalTypeSerializer<TActualType, TNominalType>
2828
private readonly Lazy<IBsonSerializer<TNominalType>> _lazyNominalTypeSerializer;
2929

3030
// constructors
31+
//DOMAIN-API This should be removed in the future.
3132
/// <summary>
3233
/// Initializes a new instance of the <see cref="SerializeAsNominalTypeSerializer{TActualType, TNominalType}"/> class.
3334
/// </summary>
3435
public SerializeAsNominalTypeSerializer()
35-
: this(BsonSerializer.SerializerRegistry) //TODO We can keep this as is
36+
: this(BsonSerializer.SerializerRegistry)
3637
{
3738
}
3839

0 commit comments

Comments
 (0)