Skip to content

Commit 35fb461

Browse files
committed
Simplification
1 parent 9570ae0 commit 35fb461

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/MongoDB.Bson/Serialization/BsonClassMap.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ public void Reset()
10571057
_creatorMaps.Clear();
10581058
_creator = null;
10591059
_declaredMemberMaps = new List<BsonMemberMap>();
1060-
_discriminator = ComputeDiscriminator();
1060+
_discriminator = BsonUtils.GetFriendlyTypeName(_classType);
10611061
_discriminatorIsRequired = false;
10621062
_extraElementsMemberMap = null;
10631063
_idMemberMap = null;
@@ -1067,24 +1067,6 @@ public void Reset()
10671067
_knownTypes.Clear();
10681068
}
10691069

1070-
private string ComputeDiscriminator()
1071-
{
1072-
/*
1073-
* The discriminator is computed as follows:
1074-
* - if the class is non generic, that's just the name of the class
1075-
* - if the class is generic, then it's the AssemblyQualifiedName
1076-
*/
1077-
1078-
if (_classType.IsGenericType)
1079-
{
1080-
return BsonUtils.GetFriendlyTypeName(_classType); //TODO We could just remove this method, keeping it in case I need to do something
1081-
}
1082-
else
1083-
{
1084-
return _classType.Name;
1085-
}
1086-
}
1087-
10881070
/// <summary>
10891071
/// Sets the creator for the object.
10901072
/// </summary>

0 commit comments

Comments
 (0)