Skip to content

Commit d2e1746

Browse files
committed
Fix
1 parent 550eb97 commit d2e1746

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/MongoDB.Bson/ObjectModel/BsonDocumentWrapper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static BsonDocumentWrapper Create<TNominalType>(TNominalType value)
104104
/// <returns>A BsonDocumentWrapper.</returns>
105105
public static BsonDocumentWrapper Create(Type nominalType, object value)
106106
{
107-
var serializer = BsonSerializer.LookupSerializer(nominalType);
107+
var serializer = BsonSerializer.LookupSerializer(nominalType); //TODO I think this could stay. We can potentially add methods with the domain as input.
108108
return new BsonDocumentWrapper(value, serializer);
109109
}
110110

@@ -121,7 +121,7 @@ public static IEnumerable<BsonDocumentWrapper> CreateMultiple<TNominalType>(IEnu
121121
throw new ArgumentNullException("values");
122122
}
123123

124-
var serializer = BsonSerializer.LookupSerializer(typeof(TNominalType));
124+
var serializer = BsonSerializer.LookupSerializer(typeof(TNominalType)); //TODO I think this could stay. We can potentially add methods with the domain as input.
125125
return values.Select(v => new BsonDocumentWrapper(v, serializer));
126126
}
127127

@@ -142,7 +142,7 @@ public static IEnumerable<BsonDocumentWrapper> CreateMultiple(Type nominalType,
142142
throw new ArgumentNullException("values");
143143
}
144144

145-
var serializer = BsonSerializer.LookupSerializer(nominalType);
145+
var serializer = BsonSerializer.LookupSerializer(nominalType); //TODO I think this could stay. We can potentially add methods with the domain as input.
146146
return values.Cast<object>().Select(v => new BsonDocumentWrapper(v, serializer));
147147
}
148148

src/MongoDB.Bson/Serialization/BsonDeserializationContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ private BsonDeserializationContext(
4444
_allowDuplicateElementNames = allowDuplicateElementNames;
4545
_dynamicArraySerializer = dynamicArraySerializer;
4646
_dynamicDocumentSerializer = dynamicDocumentSerializer;
47-
_domain = domain ?? BsonSerializer.DefaultDomain; //TODO Should we do it here or higher in the hierarchy...?
47+
_domain = domain;
48+
// _domain = domain ?? BsonSerializer.DefaultDomain; //TODO We could do this here, but let's keep it as the previous line to catch errors.
4849
}
4950

5051
// public properties

src/MongoDB.Bson/Serialization/BsonSerializationContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ private BsonSerializationContext(
3636
{
3737
_writer = writer;
3838
_isDynamicType = isDynamicType;
39-
_domain = domain ?? BsonSerializer.DefaultDomain; //TODO Should we do it here or higher in the hierarchy...?
39+
_domain = domain;
40+
// _domain = domain ?? BsonSerializer.DefaultDomain; //TODO We could do this here, but let's keep it as the previous line to catch errors.
4041
}
4142

4243
// public properties

0 commit comments

Comments
 (0)