You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The library will cause the MongoDB driver to throw if the consumer code tries to configure AutoMaps before the MongoStaticInitializer is executed.
To Reproduce
Add this class somewhere.
public class GuidHavingClass
{
protected GuidHavingClass()
{
this.Id = Guid.NewGuid();
}
public Guid Id { get; init; }
}
Expected behavior
The library should not use lazy instanciation for the static registrations as it makes it a lot harder to fiddle with it in our own configuration code. For example, we cannot unregister the EnumRepresentationConvention to set it to BsonType.Int32 instead.
Screenshots
Due to the fact that we try to use a Guid as the Id mongo will look for a serializer and add one of it fails to find one.
Then once the code tries to create a MongoClient instance the driver will throw
Environment (please complete the following information):
any
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
The library will cause the MongoDB driver to throw if the consumer code tries to configure AutoMaps before the MongoStaticInitializer is executed.
To Reproduce
Add this class somewhere.
Then add this piece of configuration
Expected behavior
The library should not use lazy instanciation for the static registrations as it makes it a lot harder to fiddle with it in our own configuration code. For example, we cannot unregister the EnumRepresentationConvention to set it to BsonType.Int32 instead.
Screenshots
Due to the fact that we try to use a Guid as the Id mongo will look for a serializer and add one of it fails to find one.
Then once the code tries to create a MongoClient instance the driver will throw
Environment (please complete the following information):
any
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: