Hi, Alexov,
GuidRepresentation.Standard is our recommended approach, which stores and transmits GUIDs using BsonBinaryData subtype 4. Separate but related is the GuidRepresentationMode, which is how the GuidRepresentation is configured. In V2 mode, GuidRepresentation is configured at the collection level where as V3 mode it is configured at the individual property level.
When using V3 mode, you can configure the default GuidSerializer globally as you noted using:
BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard));
Due to backward compatibility concerns, we were unable to change these defaults to GuidRepresentation.Standard, GuidRepresentationMode.V3, and the default GUID serializer in the 2.X driver series. BsonDefaults.GuidRepresentation and BsonDefaults.GuidRepresentationMode allow you to opt into these preferred defaults.
Now for the confusing aspect… We intend to make GuidRepresentation.Standard and GuidRepresentationMode.V3 the defaults in a future version of the driver and eventually not support the old defaults. Thus BsonDefaults.GuidRepresentation and BsonDefaults.GuidRepresentationMode will be going away in a future version of the driver as these options will not be configurable, which is why we marked these APIs as deprecated. However we marked them as deprecated too aggressively as we fully intend users to use these properties to set the GUID-related defaults in the v2.X series of the driver.
You can disable these warnings with a #pragma as follows as we do internally within the driver code:
#pragma warning disable 618
BsonDefaults.GuidRepresentation = GuidRepresentation.Standard;
BsonDefaults.GuidRepresentationMode = GuidRepresentationMode.V3;
#pragma warning restore
Please let us know if you have any additional questions.
Sincerely,
James