private static void DoAdd(IServiceCollection services, MongoDbServiceInfo info, IConfiguration config, ServiceLifetime contextLifetime, IHealthChecksBuilder healthChecksBuilder)
        {
            Type mongoClient   = MongoDbTypeLocator.MongoClient;
            var  mongoOptions  = new MongoDbConnectorOptions(config);
            var  clientFactory = new MongoDbConnectorFactory(info, mongoOptions, mongoClient);

            services.Add(new ServiceDescriptor(MongoDbTypeLocator.IMongoClient, clientFactory.Create, contextLifetime));
            services.Add(new ServiceDescriptor(mongoClient, clientFactory.Create, contextLifetime));
            if (healthChecksBuilder == null)
            {
                services.Add(new ServiceDescriptor(typeof(IHealthContributor), ctx => new MongoDbHealthContributor(clientFactory, ctx.GetService <ILogger <MongoDbHealthContributor> >()), ServiceLifetime.Singleton));
            }
            else
            {
                healthChecksBuilder.AddMongoDb(clientFactory.CreateConnectionString());
            }

            Type mongoInfo  = ConnectorHelpers.FindType(MongoDbTypeLocator.Assemblies, MongoDbTypeLocator.MongoConnectionInfo);
            var  urlFactory = new MongoDbConnectorFactory(info, mongoOptions, mongoInfo);

            services.Add(new ServiceDescriptor(mongoInfo, urlFactory.Create, contextLifetime));
        }