Browse Source

Update Guid serializer registration in AbpMongoDbModule

pull/23673/head
maliming 1 year ago
parent
commit
f22df7dbb9
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 3
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs

3
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs

@ -19,7 +19,8 @@ public class AbpMongoDbModule : AbpModule
{ {
static AbpMongoDbModule() static AbpMongoDbModule()
{ {
BsonSerializer.TryRegisterSerializer(new GuidSerializer(GuidRepresentation.Standard)); AbpBsonSerializer.RemoveSerializer<Guid>();
BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard));
BsonTypeMapper.RegisterCustomTypeMapper(typeof(Guid), new AbpGuidCustomBsonTypeMapper()); BsonTypeMapper.RegisterCustomTypeMapper(typeof(Guid), new AbpGuidCustomBsonTypeMapper());
} }

Loading…
Cancel
Save