public CosmosDbRepository([NotNull] CosmosDbRepositoryOptions options)
 {
     _splitByType             = options.SplitByType;
     _useItemIdAsPartitionKey = options.UseItemIdAsPartitionKey;
     _cosmosDbAdapter         = new CosmosDbAdapter <TItem>(options.ConnectionString, options.CosmosClientOptions, options.DatabaseName, options.CollectionName);
     IsInitialized            = true;
 }
    public static IServiceCollection AddCosmosDb(this IServiceCollection serviceCollection, Action <CosmosDbRepositoryOptions> action)
    {
        var connectionOptions = new CosmosDbRepositoryOptions();

        action.Invoke(connectionOptions);

        serviceCollection.AddSingleton(connectionOptions);

        return(serviceCollection);
    }