Shared serializer configuration between EF Provider and bare Driver

In our current project we went all in the new EF Provider despite its lacking in features. This is because of the promise we can always just drop to bare Driver and use it. And so far this is working out for us just fine, we do our aggregations in driver while leaving most of the boring CRUD stuff to EF.

But we have one issue with going back and forth between EF and driver - serializers configuration. So far, as I understand, EF provider is setting up it’s own serializers, but it’s not doing that globally. So whenever we are dropping to the driver we have to think about serialization again, setup things like Guids separately.

For example, we are using Guid extensively, so whenever we want to do aggregation on collection that contain Guids we need to do this:

BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard));
var discriminatorConvention = BsonSerializer.LookupDiscriminatorConvention(typeof(object));
var objectSerializer = new ObjectSerializer(discriminatorConvention, GuidRepresentation.Standard);
BsonSerializer.RegisterSerializer(objectSerializer);

So it’s our responsibility to call it in a proper place and make sure that it’s there whenever we are using driver. We also had serializer difference for decimal type between driver and EF provider.

I think I understand why that is, EF is keeping it’s own configuration to not interfere with existing Driver configuration. But (here is my feature proposal) what if there was to way to say “hey, those serializer things you have for EF - please set this globally so i can use Driver without additional setup and worrying about such stuff”.

Have you thought about such solution? It would be really great for us