public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options) { this.documentStore = documentStore; databaseCommands = database == null ? documentStore.DatabaseCommands.ForSystemDatabase() : documentStore.DatabaseCommands.ForDatabase(database); generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKey(database, databaseCommands, entity)); operation = databaseCommands.GetBulkInsertOperation(options); entityToJson = new EntityToJson(documentStore, listeners); }