Skip to content

Commit 3bbe170

Browse files
committed
Various improvements
1 parent 01df61f commit 3bbe170

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

src/MongoDB.Bson/IO/IBsonReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public interface IBsonReader : IDisposable
6262
/// <summary>
6363
/// Pops the settings.
6464
/// </summary>
65-
void PopSettings(); //TODO Why do we have push and pop methods? They are not used. We should remove them.
65+
void PopSettings();
6666

6767
/// <summary>
6868
/// Pushes new settings for the reader.

src/MongoDB.Bson/Serialization/BsonSerializerRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class BsonSerializerRegistry : IBsonSerializerRegistryInternal
2828
private readonly ConcurrentDictionary<Type, IBsonSerializer> _cache;
2929
private readonly ConcurrentStack<IBsonSerializationProvider> _serializationProviders;
3030
private readonly Func<Type, IBsonSerializer> _createSerializer;
31-
private readonly IBsonSerializationDomain _serializationDomain;
31+
private readonly IBsonSerializationDomain _serializationDomain; //FP Need to investigate if we can remove this from here.
3232

3333
// constructors
3434
/// <summary>

src/MongoDB.Bson/Serialization/Conventions/ConventionRegistryDomain.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/* Copyright 2010-present MongoDB Inc.
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
116
using System;
217
using System.Collections.Generic;
318

src/MongoDB.Bson/Serialization/Conventions/ObjectDiscriminatorConvention.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,6 @@ public BsonValue GetDiscriminator(Type nominalType, Type actualType)
159159
return TypeNameDiscriminator.GetDiscriminator(actualType);
160160
}
161161

162-
/// <inheritdoc />
163-
internal BsonValue GetDiscriminator(Type nominalType, Type actualType, IBsonSerializationDomain domain)
164-
{
165-
throw new NotImplementedException();
166-
}
167-
168162
/// <inheritdoc/>
169163
public override int GetHashCode() => 0;
170164
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace MongoDB.Bson.Serialization.Serializers
2727
public abstract class DynamicDocumentBaseSerializer<T> : SerializerBase<T> where T : class, IDynamicMetaObjectProvider
2828
{
2929
// private fields
30-
private IBsonSerializer<object> __objectSerializer;
30+
private IBsonSerializer<object> _objectSerializer;
3131

3232
// constructors
3333
/// <summary>
@@ -146,7 +146,7 @@ public override void Serialize(BsonSerializationContext context, BsonSerializati
146146
//private methods
147147
private IBsonSerializer<object> GetObjectSerializer(IBsonSerializationDomain domain)
148148
{
149-
return __objectSerializer ??= domain.LookupSerializer<object>();
149+
return _objectSerializer ??= domain.LookupSerializer<object>();
150150
}
151151
}
152152
}

src/MongoDB.Driver/MongoDB.Driver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<IsPackable>true</IsPackable>
1414
</PropertyGroup>
1515

16-
<!-- The followings have been removed because they are accessed directly through MongoDB.Bson, otherwise there will be a double definition -->
16+
<!-- The followings have been removed because they are accessed indirectly through MongoDB.Bson, otherwise there will be a double definition -->
1717
<!-- <ItemGroup>-->
1818
<!-- <Compile Include="..\MongoDB.Shared\DictionaryComparer.cs" Link="Shared\DictionaryComparer.cs" />-->
1919
<!-- <Compile Include="..\MongoDB.Shared\SequenceComparer.cs" Link="Shared\SequenceComparer.cs" />-->

0 commit comments

Comments
 (0)